vfs_nfs4acl_xattr: add POSIX mode check and reset
authorRalph Boehme <slow@samba.org>
Wed, 18 Oct 2017 18:45:05 +0000 (20:45 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 7 Nov 2017 23:20:08 +0000 (00:20 +0100)
commit0fdbe624fd708f372b9a1fe4176e04ebb1b040d6
treeb4629637d11175789dc01581cbb53e873178adb4
parentb4072961c691dbe7434b077147a89d927a299570
vfs_nfs4acl_xattr: add POSIX mode check and reset

The vfs_nfs4acl_xattr VFS module is supposed to work the same as
vfs_acl_xattr|tdb with "ignore system acls" set to true. That is,
filesystem permissions should never restrict access and the actual
access checks are done by smbd in userspace.

To better cope with POSIX mode changes via other protocols (eg NFS) or
local filesystem access, add the following tweaks:

o validate ACL blob: if POSIX mode is not 0777/0666 discard the ACL blob
  from the xattr and synthesize a default ACL based on the POSIX mode

o when setting an ACL, check and reset POSIX mode to 0777/0666

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_nfs4acl_xattr.c