diff options
author | Steve French <sfrench@us.ibm.com> | 2007-06-08 14:55:14 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-06-08 14:55:14 +0000 |
commit | 3ce53fc4c57603d99c330a6ee2fe96d94f2d350f (patch) | |
tree | 54a5e999cc6044669139fb5e3a7cc0a1db31e86f /fs/cifs/inode.c | |
parent | 100c1ddc98e070c1b595d6bad329fb57bc57313c (diff) | |
download | lwn-3ce53fc4c57603d99c330a6ee2fe96d94f2d350f.tar.gz lwn-3ce53fc4c57603d99c330a6ee2fe96d94f2d350f.zip |
[CIFS] CIFS should honour umask
This patch makes CIFS honour a process' umask like other filesystems.
Of course the server is still free to munge the permissions if it wants
to; but the client will send the "right" permissions to begin with.
A few caveats:
1) It only applies to filesystems that have CAP_UNIX (aka support unix
extensions)
2) It applies the correct mode to the follow up CIFSSMBUnixSetPerms()
after remote creation
When mode to CIFS/NTFS ACL mapping is complete we can do the
same thing for that case for servers which do not
support the Unix Extensions.
Signed-off-by: Matt Keenen <matt@opcode-solutions.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 3e87dad3367c..f0ff12b3f398 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -986,7 +986,8 @@ mkdir_get_info: * failed to get it from the server or was set bogus */ if ((direntry->d_inode) && (direntry->d_inode->i_nlink < 2)) direntry->d_inode->i_nlink = 2; - if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) + if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) { + mode &= ~current->fs->umask; if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode, @@ -1004,7 +1005,7 @@ mkdir_get_info: cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); } - else { + } else { /* BB to be implemented via Windows secrty descriptors eg CIFSSMBWinSetPerms(xid, pTcon, full_path, mode, -1, -1, local_nls); */ |