mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
setfacl removes part of ACL when setting POSIX ACLs to Samba
commit b1d9335642
upstream.
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😷: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
Signed-off-by: Steve French <smfrench@gmail.com>
Acked-by: Jeremy Allison <jra@samba.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0c5e98d553
commit
afaf7f61a5
1 changed files with 5 additions and 3 deletions
|
@ -3454,11 +3454,13 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
|
|||
return 0;
|
||||
}
|
||||
cifs_acl->version = cpu_to_le16(1);
|
||||
if (acl_type == ACL_TYPE_ACCESS)
|
||||
if (acl_type == ACL_TYPE_ACCESS) {
|
||||
cifs_acl->access_entry_count = cpu_to_le16(count);
|
||||
else if (acl_type == ACL_TYPE_DEFAULT)
|
||||
cifs_acl->default_entry_count = __constant_cpu_to_le16(0xFFFF);
|
||||
} else if (acl_type == ACL_TYPE_DEFAULT) {
|
||||
cifs_acl->default_entry_count = cpu_to_le16(count);
|
||||
else {
|
||||
cifs_acl->access_entry_count = __constant_cpu_to_le16(0xFFFF);
|
||||
} else {
|
||||
cFYI(1, "unknown ACL type %d", acl_type);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue