summaryrefslogtreecommitdiff
path: root/libdiskfs/file-chown.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-24 19:03:31 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-24 19:03:31 +0000
commit90e7d441d7e32d891050b3f5d6c16ca4bfc764e1 (patch)
treee2eed4d8d8630e314695c5e33c2931face65cf6a /libdiskfs/file-chown.c
parent789851ceafac05821bf438c61a08966a3f3a9bef (diff)
(diskfs_S_file_chown): Validate owner change before making it.
Diffstat (limited to 'libdiskfs/file-chown.c')
-rw-r--r--libdiskfs/file-chown.c14
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;
+ }
}
}));
}