summaryrefslogtreecommitdiff
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-11-29 20:20:10 -0800
committerSteve French <sfrench@us.ibm.com>2005-11-29 20:20:10 -0800
commit6473a559c336d5c407f9df412ca2f55357767ff8 (patch)
treeededf2b339de4541e98c78b5d537ab954d9dc413 /fs/cifs/dir.c
parent3abb92722ab1784b419dadb5444daf8ea9636905 (diff)
[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.c9
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) {