diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-06-24 19:03:31 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-06-24 19:03:31 +0000 |
commit | 90e7d441d7e32d891050b3f5d6c16ca4bfc764e1 (patch) | |
tree | e2eed4d8d8630e314695c5e33c2931face65cf6a | |
parent | 789851ceafac05821bf438c61a08966a3f3a9bef (diff) |
(diskfs_S_file_chown): Validate owner change before making it.
-rw-r--r-- | libdiskfs/file-chown.c | 14 |
1 files 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; + } } })); } |