aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-04-06 19:28:16 +0000
committerSteve French <sfrench@us.ibm.com>2007-04-06 19:28:16 +0000
commit5268df2ead6def933ace27ab4d46f67d2989b905 (patch)
tree422c16749ae45fd349d3b64b4ad07fcbb16368c2 /fs/cifs/inode.c
parent3a9f462f6d07ab6f26a347120e173e945139befd (diff)
downloadkernel_samsung_smdk4412-5268df2ead6def933ace27ab4d46f67d2989b905.zip
kernel_samsung_smdk4412-5268df2ead6def933ace27ab4d46f67d2989b905.tar.gz
kernel_samsung_smdk4412-5268df2ead6def933ace27ab4d46f67d2989b905.tar.bz2
[CIFS] Add write perm for usr to file on windows should remove r/o dos attr
Remove read only dos attribute on chmod when adding any write permission (ie on any of user/group/other (not all of user/group/other ie 0222) when mounted to windows. Suggested by: Urs Fleisch Signed-off-by: Urs Fleisch <urs.fleisch@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index f414526..eeea337 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1339,17 +1339,17 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
cpu_to_le32(cifsInode->cifsAttrs |
ATTR_READONLY);
}
- } else if ((mode & S_IWUGO) == S_IWUGO) {
- if (cifsInode->cifsAttrs & ATTR_READONLY) {
- set_dosattr = TRUE;
- time_buf.Attributes =
- cpu_to_le32(cifsInode->cifsAttrs &
- (~ATTR_READONLY));
- /* Windows ignores set to zero */
- if(time_buf.Attributes == 0)
- time_buf.Attributes |=
- cpu_to_le32(ATTR_NORMAL);
- }
+ } else if (cifsInode->cifsAttrs & ATTR_READONLY) {
+ /* If file is readonly on server, we would
+ not be able to write to it - so if any write
+ bit is enabled for user or group or other we
+ need to at least try to remove r/o dos attr */
+ set_dosattr = TRUE;
+ time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs &
+ (~ATTR_READONLY));
+ /* Windows ignores set to zero */
+ if(time_buf.Attributes == 0)
+ time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL);
}
/* BB to be implemented -
via Windows security descriptors or streams */