aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorTim Shimmin <tes@sgi.com>2008-10-30 03:30:48 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-10-30 03:30:48 -0400
commite0b8e8b65d578f5d5538465dff8392cf02e1cc5d (patch)
treebe3d83c0db87e305ea7af18f3ab5cefaa0032b49 /fs/xfs/xfs_vnodeops.c
parentf3f0d7b026ae34d6ed5ae67cd4dd5909f9cd70a5 (diff)
[XFS] remove restricted chown parameter from xfs linux
On Linux all filesystems are supposed to be operating under Posix' restricted chown. Restricted chown means it restricts chown to the owner unless you have CAP_FOWNER. NOTE: that 2 files outside of fs/xfs have been modified too for this change. Reviewed-by: Dave Chinner <david@fromorbit.com> SGI-PV: 988919 SGI-Modid: xfs-linux-melb:xfs-kern:32413a Signed-off-by: Tim Shimmin <tes@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 34a1982ed6dc..c45ea278ef41 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -232,10 +232,6 @@ xfs_setattr(
232 232
233 /* 233 /*
234 * Change file ownership. Must be the owner or privileged. 234 * Change file ownership. Must be the owner or privileged.
235 * If the system was configured with the "restricted_chown"
236 * option, the owner is not permitted to give away the file,
237 * and can change the group id only to a group of which he
238 * or she is a member.
239 */ 235 */
240 if (mask & (ATTR_UID|ATTR_GID)) { 236 if (mask & (ATTR_UID|ATTR_GID)) {
241 /* 237 /*
@@ -259,9 +255,8 @@ xfs_setattr(
259 * shall be equal to either the group ID or one of the 255 * shall be equal to either the group ID or one of the
260 * supplementary group IDs of the calling process. 256 * supplementary group IDs of the calling process.
261 */ 257 */
262 if (restricted_chown && 258 if ((iuid != uid ||
263 (iuid != uid || (igid != gid && 259 (igid != gid && !in_group_p((gid_t)gid))) &&
264 !in_group_p((gid_t)gid))) &&
265 !capable(CAP_CHOWN)) { 260 !capable(CAP_CHOWN)) {
266 code = XFS_ERROR(EPERM); 261 code = XFS_ERROR(EPERM);
267 goto error_return; 262 goto error_return;
@@ -455,10 +450,6 @@ xfs_setattr(
455 450
456 /* 451 /*
457 * Change file ownership. Must be the owner or privileged. 452 * Change file ownership. Must be the owner or privileged.
458 * If the system was configured with the "restricted_chown"
459 * option, the owner is not permitted to give away the file,
460 * and can change the group id only to a group of which he
461 * or she is a member.
462 */ 453 */
463 if (mask & (ATTR_UID|ATTR_GID)) { 454 if (mask & (ATTR_UID|ATTR_GID)) {
464 /* 455 /*