1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

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>
This commit is contained in:
Christof Schmitt 2019-07-15 13:15:32 -07:00
parent d9a2ff559e
commit f198a0867e

View File

@ -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;
}
}