aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2013-11-15 21:41:32 -0500
committerSteve French <smfrench@gmail.com>2013-11-15 21:50:58 -0500
commitb1d93356427be6f050dc55c86eb019d173700af6 (patch)
tree70adc3282f8f5fc535aa440f24d5ca695cdc178f /fs/cifs/cifssmb.c
parentde9f68df675e9d8b0b6a533818a79dca6546a7ba (diff)
setfacl removes part of ACL when setting POSIX ACLs to Samba
setfacl over cifs mounts can remove the default ACL when setting the (non-default part of) the ACL and vice versa (we were leaving at 0 rather than setting to -1 the count field for the unaffected half of the ACL. For example notice the setfacl removed the default ACL in this sequence: steven@steven-GA-970A-DS3:~/cifs-2.6$ getfacl /mnt/test-dir ; setfacl -m default:user:test:rwx,user:test:rwx /mnt/test-dir getfacl: Removing leading '/' from absolute path names user::rwx group::r-x other::r-x default:user::rwx default:user:test:rwx default:group::r-x default:mask::rwx default:other::r-x steven@steven-GA-970A-DS3:~/cifs-2.6$ getfacl /mnt/test-dir getfacl: Removing leading '/' from absolute path names user::rwx user:test:rwx group::r-x mask::rwx other::r-x CC: Stable <stable@kernel.org> Signed-off-by: Steve French <smfrench@gmail.com> Acked-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 93b29474714a..124aa0230c1b 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -3369,11 +3369,13 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
3369 return 0; 3369 return 0;
3370 } 3370 }
3371 cifs_acl->version = cpu_to_le16(1); 3371 cifs_acl->version = cpu_to_le16(1);
3372 if (acl_type == ACL_TYPE_ACCESS) 3372 if (acl_type == ACL_TYPE_ACCESS) {
3373 cifs_acl->access_entry_count = cpu_to_le16(count); 3373 cifs_acl->access_entry_count = cpu_to_le16(count);
3374 else if (acl_type == ACL_TYPE_DEFAULT) 3374 cifs_acl->default_entry_count = __constant_cpu_to_le16(0xFFFF);
3375 } else if (acl_type == ACL_TYPE_DEFAULT) {
3375 cifs_acl->default_entry_count = cpu_to_le16(count); 3376 cifs_acl->default_entry_count = cpu_to_le16(count);
3376 else { 3377 cifs_acl->access_entry_count = __constant_cpu_to_le16(0xFFFF);
3378 } else {
3377 cifs_dbg(FYI, "unknown ACL type %d\n", acl_type); 3379 cifs_dbg(FYI, "unknown ACL type %d\n", acl_type);
3378 return 0; 3380 return 0;
3379 } 3381 }