diff options
author | Chris Wright <chrisw@osdl.org> | 2004-07-02 06:55:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-02 06:55:04 -0700 |
commit | db376e4c7817acf3f8e83af76acaf3f840e21827 (patch) | |
tree | 9176fe25dfae867082d63862ef7dd158cdb00a4d /fs | |
parent | 7caf4f46ef30b2666453f8b2c289559af4bc90ea (diff) | |
download | history-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.c | 3 |
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; |