Skip to content

Commit

Permalink
libcli/security: ace type is not enum not flags
Browse files Browse the repository at this point in the history
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
douglasbagnall authored and abartlet committed Apr 28, 2023
1 parent 56da318 commit 251da18
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libcli/security/sddl.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ static bool sddl_decode_ace(TALLOC_CTX *mem_ctx, struct security_ace *ace, char
uint32_t v;
struct dom_sid *sid;
bool ok;
size_t len;

ZERO_STRUCTP(ace);

Expand All @@ -418,9 +419,16 @@ static bool sddl_decode_ace(TALLOC_CTX *mem_ctx, struct security_ace *ace, char
}

/* parse ace type */
if (!sddl_map_flags(ace_types, tok[0], &v, NULL, false)) {
ok = sddl_map_flag(ace_types, tok[0], &len, &v);
if (!ok) {
DBG_WARNING("Unknown ACE type - %s\n", tok[0]);
return false;
}
if (tok[0][len] != '\0') {
DBG_WARNING("Garbage after ACE type - %s\n", tok[0]);
return false;
}

ace->type = v;

/* ace flags */
Expand Down

0 comments on commit 251da18

Please sign in to comment.