diff options
author | Steve French <sfrench@us.ibm.com> | 2007-12-31 07:47:21 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-12-31 07:47:21 +0000 |
commit | 97837582bc1e191d2792af74c1f3762ed01243b9 (patch) | |
tree | c472591913d02cc4fb107815c53221044fdc9a6c /fs/cifs/inode.c | |
parent | 28c5a02a11f70bb1fd8dd3b633206e2db3220308 (diff) | |
download | lwn-97837582bc1e191d2792af74c1f3762ed01243b9.tar.gz lwn-97837582bc1e191d2792af74c1f3762ed01243b9.zip |
[CIFS] Allow setting mode via cifs acl
Requires cifsacl mount flag to be on and CIFS_EXPERIMENTAL enabled
CC: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index e915eb1d2e66..fdc0fe109d7b 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1607,7 +1607,13 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) CIFS_MOUNT_MAP_SPECIAL_CHR); else if (attrs->ia_valid & ATTR_MODE) { rc = 0; +#ifdef CONFIG_CIFS_EXPERIMENTAL + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) + rc = mode_to_acl(direntry->d_inode, full_path, mode); + else if ((mode & S_IWUGO) == 0) /* not writeable */ { +#else if ((mode & S_IWUGO) == 0) /* not writeable */ { +#endif if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) { set_dosattr = TRUE; time_buf.Attributes = @@ -1626,10 +1632,10 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) if (time_buf.Attributes == 0) time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL); } - /* BB to be implemented - - via Windows security descriptors or streams */ - /* CIFSSMBWinSetPerms(xid, pTcon, full_path, mode, uid, gid, - cifs_sb->local_nls); */ +#ifdef CONFIG_CIFS_EXPERIMENTAL + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) + mode_to_acl(direntry->d_inode, full_path, mode); +#endif } if (attrs->ia_valid & ATTR_ATIME) { |