From: Steve French Date: Mon, 17 Dec 2007 22:08:58 +0000 (+0100) Subject: CIFS: Respect umask when using POSIX mkdir X-Git-Tag: v2.6.23.15~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72754b23ef3a4b1b1982ce51a9778bf491f1bd1f;p=thirdparty%2Fkernel%2Fstable.git CIFS: Respect umask when using POSIX mkdir patch a8cd925f74c3b1b6d1192f9e75f9d12cc2ab148a in mainline. [CIFS] Respect umask when using POSIX mkdir When making a directory with POSIX mkdir calls, cifs_mkdir does not respect the umask. This patch causes the new POSIX mkdir to create with the right mode Signed-off-by: Jeff Layton Signed-off-by: Steve French Cc: maximilian attems Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index dd4167762a8ed..48a61da6c5177 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -919,6 +919,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) goto mkdir_out; } + mode &= ~current->fs->umask; rc = CIFSPOSIXCreate(xid, pTcon, SMB_O_DIRECTORY | SMB_O_CREAT, mode, NULL /* netfid */, pInfo, &oplock, full_path, cifs_sb->local_nls,