diff options
author | Steve French <sfrench@us.ibm.com> | 2007-04-06 15:28:16 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-04-06 15:28:16 -0400 |
commit | 5268df2ead6def933ace27ab4d46f67d2989b905 (patch) | |
tree | 422c16749ae45fd349d3b64b4ad07fcbb16368c2 /fs/cifs/inode.c | |
parent | 3a9f462f6d07ab6f26a347120e173e945139befd (diff) |
[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.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index f414526e476a..eeea33752e68 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1339,17 +1339,17 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1339 | cpu_to_le32(cifsInode->cifsAttrs | | 1339 | cpu_to_le32(cifsInode->cifsAttrs | |
1340 | ATTR_READONLY); | 1340 | ATTR_READONLY); |
1341 | } | 1341 | } |
1342 | } else if ((mode & S_IWUGO) == S_IWUGO) { | 1342 | } else if (cifsInode->cifsAttrs & ATTR_READONLY) { |
1343 | if (cifsInode->cifsAttrs & ATTR_READONLY) { | 1343 | /* If file is readonly on server, we would |
1344 | set_dosattr = TRUE; | 1344 | not be able to write to it - so if any write |
1345 | time_buf.Attributes = | 1345 | bit is enabled for user or group or other we |
1346 | cpu_to_le32(cifsInode->cifsAttrs & | 1346 | need to at least try to remove r/o dos attr */ |
1347 | (~ATTR_READONLY)); | 1347 | set_dosattr = TRUE; |
1348 | /* Windows ignores set to zero */ | 1348 | time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs & |
1349 | if(time_buf.Attributes == 0) | 1349 | (~ATTR_READONLY)); |
1350 | time_buf.Attributes |= | 1350 | /* Windows ignores set to zero */ |
1351 | cpu_to_le32(ATTR_NORMAL); | 1351 | if(time_buf.Attributes == 0) |
1352 | } | 1352 | time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL); |
1353 | } | 1353 | } |
1354 | /* BB to be implemented - | 1354 | /* BB to be implemented - |
1355 | via Windows security descriptors or streams */ | 1355 | via Windows security descriptors or streams */ |