Commit 5268df2e authored by Steve French's avatar Steve French

[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: default avatarUrs Fleisch <urs.fleisch@gmail.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 3a9f462f
...@@ -9,7 +9,10 @@ from read-only back to read-write, reflect this change in default file mode ...@@ -9,7 +9,10 @@ from read-only back to read-write, reflect this change in default file mode
(we had been leaving a file's mode read-only until the inode were reloaded). (we had been leaving a file's mode read-only until the inode were reloaded).
Allow setting of attribute back to ATTR_NORMAL (removing readonly dos attribute Allow setting of attribute back to ATTR_NORMAL (removing readonly dos attribute
when archive dos attribute not set and we are changing mode back to writeable when archive dos attribute not set and we are changing mode back to writeable
on server which does not support the Unix Extensions). on server which does not support the Unix Extensions). 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.
Version 1.47 Version 1.47
------------ ------------
......
...@@ -1339,17 +1339,17 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) ...@@ -1339,17 +1339,17 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
cpu_to_le32(cifsInode->cifsAttrs | cpu_to_le32(cifsInode->cifsAttrs |
ATTR_READONLY); ATTR_READONLY);
} }
} else if ((mode & S_IWUGO) == S_IWUGO) { } else if (cifsInode->cifsAttrs & ATTR_READONLY) {
if (cifsInode->cifsAttrs & ATTR_READONLY) { /* If file is readonly on server, we would
set_dosattr = TRUE; not be able to write to it - so if any write
time_buf.Attributes = bit is enabled for user or group or other we
cpu_to_le32(cifsInode->cifsAttrs & need to at least try to remove r/o dos attr */
(~ATTR_READONLY)); set_dosattr = TRUE;
/* Windows ignores set to zero */ time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs &
if(time_buf.Attributes == 0) (~ATTR_READONLY));
time_buf.Attributes |= /* Windows ignores set to zero */
cpu_to_le32(ATTR_NORMAL); if(time_buf.Attributes == 0)
} time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL);
} }
/* BB to be implemented - /* BB to be implemented -
via Windows security descriptors or streams */ via Windows security descriptors or streams */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment