diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 13 |
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 | /* |