summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2019-07-15 13:15:32 -0700
committerKarolin Seeger <kseeger@samba.org>2019-08-23 08:59:24 +0000
commitf321f066d197c1104014b275b22cf29ead99e61b (patch)
tree757f56016f2194aa153b2a1aca88eeccaedb2189 /source3/modules
parent8acc497981773391e192401354e4ff4644632fb5 (diff)
downloadsamba-f321f066d197c1104014b275b22cf29ead99e61b.tar.gz
nfs4_acls: Use switch/case for checking idmap type
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14032 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit f198a0867e71f248d4887ab0b6f2832123b16d11)
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/nfs4_acls.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 4069c9310ed..f8861e9058b 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -730,18 +730,27 @@ static bool smbacl4_fill_ace4(
return false;
}
- if (unixid.type == ID_TYPE_GID || unixid.type == ID_TYPE_BOTH) {
+ if (dom_sid_compare_domain(&ace_nt->trustee,
+ &global_sid_Unix_NFS) == 0) {
+ return false;
+ }
+
+ switch (unixid.type) {
+ case ID_TYPE_BOTH:
ace_v4->aceFlags |= SMB_ACE4_IDENTIFIER_GROUP;
ace_v4->who.gid = unixid.id;
- } else if (unixid.type == ID_TYPE_UID) {
+ break;
+ case ID_TYPE_GID:
+ ace_v4->aceFlags |= SMB_ACE4_IDENTIFIER_GROUP;
+ ace_v4->who.gid = unixid.id;
+ break;
+ case ID_TYPE_UID:
ace_v4->who.uid = unixid.id;
- } else if (dom_sid_compare_domain(&ace_nt->trustee,
- &global_sid_Unix_NFS) == 0) {
- return false;
- } else {
- DEBUG(1, ("nfs4_acls.c: could not "
- "convert %s to uid or gid\n",
- dom_sid_str_buf(&ace_nt->trustee, &buf)));
+ break;
+ case ID_TYPE_NOT_SPECIFIED:
+ default:
+ DBG_WARNING("Could not convert %s to uid or gid.\n",
+ dom_sid_str_buf(&ace_nt->trustee, &buf));
return false;
}
}