aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-04-06 15:28:16 -0400
committerSteve French <sfrench@us.ibm.com>2007-04-06 15:28:16 -0400
commit5268df2ead6def933ace27ab4d46f67d2989b905 (patch)
tree422c16749ae45fd349d3b64b4ad07fcbb16368c2
parent3a9f462f6d07ab6f26a347120e173e945139befd (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>
-rw-r--r--fs/cifs/CHANGES5
-rw-r--r--fs/cifs/inode.c22
2 files changed, 15 insertions, 12 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 5d1f4873d701..f75bdc661769 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -9,7 +9,10 @@ from read-only back to read-write, reflect this change in default file mode
9(we had been leaving a file's mode read-only until the inode were reloaded). 9(we had been leaving a file's mode read-only until the inode were reloaded).
10Allow setting of attribute back to ATTR_NORMAL (removing readonly dos attribute 10Allow setting of attribute back to ATTR_NORMAL (removing readonly dos attribute
11when archive dos attribute not set and we are changing mode back to writeable 11when archive dos attribute not set and we are changing mode back to writeable
12on server which does not support the Unix Extensions). 12on server which does not support the Unix Extensions). Remove read only dos
13attribute on chmod when adding any write permission (ie on any of
14user/group/other (not all of user/group/other ie 0222) when
15mounted to windows.
13 16
14Version 1.47 17Version 1.47
15------------ 18------------
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 */