From 90e7d441d7e32d891050b3f5d6c16ca4bfc764e1 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 24 Jun 1996 19:03:31 +0000 Subject: (diskfs_S_file_chown): Validate owner change before making it. --- libdiskfs/file-chown.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libdiskfs/file-chown.c b/libdiskfs/file-chown.c index c0f685c7..626640ae 100644 --- a/libdiskfs/file-chown.c +++ b/libdiskfs/file-chown.c @@ -1,5 +1,5 @@ /* libdiskfs implementetation of fs.defs: file_chown - Copyright (C) 1992, 1993, 1994 Free Software Foundation + Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -32,11 +32,15 @@ diskfs_S_file_chown (struct protid *cred, || !diskfs_groupmember (gid, cred)) && !diskfs_isuid (0, cred))) err = EPERM; - else + else { - np->dn_stat.st_uid = uid; - np->dn_stat.st_gid = gid; - np->dn_set_ctime = 1; + err = diskfs_validate_owner_change (np, uid); + if (!err) + { + np->dn_stat.st_uid = uid; + np->dn_stat.st_gid = gid; + np->dn_set_ctime = 1; + } } })); } -- cgit v1.2.3