setfacl removes part of ACL when setting POSIX ACLs to Samba
authorSteve French <smfrench@gmail.com>
Sat, 16 Nov 2013 02:41:32 +0000 (20:41 -0600)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 3 Jan 2014 04:33:22 +0000 (04:33 +0000)
commitbaf48b7f96f5cd7f8b510dba67bcbdf96df296ff
treec652b286548b8c4657d623fd19fb7305aeef89f9
parentc9cc1d7f04d2dfb034162b9a21d2183c1b302501
setfacl removes part of ACL when setting POSIX ACLs to Samba

commit b1d93356427be6f050dc55c86eb019d173700af6 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: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

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>
fs/cifs/cifssmb.c