aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Wright <chrisw@osdl.org>2004-07-02 06:55:04 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-02 06:55:04 -0700
commitdb376e4c7817acf3f8e83af76acaf3f840e21827 (patch)
tree9176fe25dfae867082d63862ef7dd158cdb00a4d /fs
parent7caf4f46ef30b2666453f8b2c289559af4bc90ea (diff)
downloadhistory-db376e4c7817acf3f8e83af76acaf3f840e21827.tar.gz
[PATCH] chown permission check fix for ATTR_GID
SuSE discovered this problem with chown and ATTR_GID. Make sure user is authorized to change the group, CAN-2004-0497.
Diffstat (limited to 'fs')
-rw-r--r--fs/attr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/attr.c b/fs/attr.c
index d63350cfcb3cb8..8acb28910d09f6 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -35,7 +35,8 @@ int inode_change_ok(struct inode *inode, struct iattr *attr)
/* Make sure caller can chgrp. */
if ((ia_valid & ATTR_GID) &&
- (!in_group_p(attr->ia_gid) && attr->ia_gid != inode->i_gid) &&
+ (current->fsuid != inode->i_uid ||
+ (!in_group_p(attr->ia_gid) && attr->ia_gid != inode->i_gid)) &&
!capable(CAP_CHOWN))
goto error;