diff options
author | Steve French <sfrench@us.ibm.com> | 2005-11-29 20:20:10 -0800 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-11-29 20:20:10 -0800 |
commit | 6473a559c336d5c407f9df412ca2f55357767ff8 (patch) | |
tree | ededf2b339de4541e98c78b5d537ab954d9dc413 /fs/cifs/dir.c | |
parent | 3abb92722ab1784b419dadb5444daf8ea9636905 (diff) | |
download | linux-stable-6473a559c336d5c407f9df412ca2f55357767ff8.tar.gz linux-stable-6473a559c336d5c407f9df412ca2f55357767ff8.tar.bz2 linux-stable-6473a559c336d5c407f9df412ca2f55357767ff8.zip |
[CIFS] Fix missing permission check on setattr when noperm mount option is
disabled. Also set mode, uid, gid better on mkdir and create for the
case when Unix Extensions is not enabled and setuids is enabled. This is
necessary to fix the hole in which chown could be allowed for non-root
users in some cases if root mounted, and also to display the mode and uid
properly in some cases.
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index aa4ea965b329..32cc96cafa3e 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -228,8 +228,15 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, else { rc = cifs_get_inode_info(&newinode, full_path, buf, inode->i_sb,xid); - if(newinode) + if(newinode) { newinode->i_mode = mode; + if((oplock & CIFS_CREATE_ACTION) && + (cifs_sb->mnt_cifs_flags & + CIFS_MOUNT_SET_UID)) { + newinode->i_uid = current->fsuid; + newinode->i_gid = current->fsgid; + } + } } if (rc != 0) { |