linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CIFS: respect umask when using POSIX mkdir
@ 2007-09-12 17:32 Jeff Layton
  0 siblings, 0 replies; only message in thread
From: Jeff Layton @ 2007-09-12 17:32 UTC (permalink / raw)
  To: linux-cifs-client; +Cc: linux-fsdevel, linux-kernel

When making a directory with POSIX mkdir calls, cifs_mkdir does not
respect the umask. This moves the AND'ing of the mode with the umask
to higher in the function so that the POSIX mkdir creates with the
correct mode.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 66436f5..260ab4e 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -908,6 +908,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
 		return -ENOMEM;
 	}
 
+	mode &= ~current->fs->umask;
 	if ((pTcon->ses->capabilities & CAP_UNIX) &&
 		(CIFS_UNIX_POSIX_PATH_OPS_CAP &
 			le64_to_cpu(pTcon->fsUnixInfo.Capability))) {
@@ -999,7 +1000,6 @@ mkdir_get_info:
 		if ((direntry->d_inode) && (direntry->d_inode->i_nlink < 2))
 				direntry->d_inode->i_nlink = 2;
 		if (pTcon->unix_ext) {
-			mode &= ~current->fs->umask;
 			if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
 				CIFSSMBUnixSetPerms(xid, pTcon, full_path,
 						    mode,
-- 
1.5.2.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-12 17:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-12 17:32 [PATCH] CIFS: respect umask when using POSIX mkdir Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).