nfs4acl: Fix owner mapping with ID_TYPE_BOTH
authorChristof Schmitt <cs@samba.org>
Mon, 12 Sep 2016 23:22:16 +0000 (16:22 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 15 Sep 2016 18:50:06 +0000 (20:50 +0200)
commit5d4f7bfda579cecb123cfb1d7130688f1d1c98b7
treee52b26815b92496e660d36c2e28e2b881610da28
parenta9a1a16cc8b87a84cdfa049ebd26bf4eac1b3618
nfs4acl: Fix owner mapping with ID_TYPE_BOTH

This fixes a corner case when using NFS4 ACLs with ID_TYPE_BOTH.  Before
this patch, the owner entry in the ACL would be mapped to a gid entry in
the NFSv4 ACL, and not the expected special owner entry. This is caused
by the id mapping returning a valid gid and the nfs4 mapping assumed
that this was actually a group.

Fix this by asking for the uid first, and explicitly checking if the
mapped uid matches the owner. That creates a uid entry in the NFSv4 ACL
that can be changed later in smbacl4_substitute_{simple,special} to the
expected special owner entry.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/nfs4_acls.c