Skip to content

Commit

Permalink
libcli: Simplify security_token_is_sid()
Browse files Browse the repository at this point in the history
Avoid an explicit if-statement.

Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
vlendec authored and jrasamba committed Jun 16, 2023
1 parent 9e27239 commit 12cbb04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libcli/security/security_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ void security_token_debug(int dbg_class, int dbg_lev, const struct security_toke

bool security_token_is_sid(const struct security_token *token, const struct dom_sid *sid)
{
bool ret;

if (token->sids == NULL) {
return false;
}
if (dom_sid_equal(&token->sids[PRIMARY_USER_SID_INDEX], sid)) {
return true;
}
return false;
ret = dom_sid_equal(&token->sids[PRIMARY_USER_SID_INDEX], sid);
return ret;
}

bool security_token_is_system(const struct security_token *token)
Expand Down

0 comments on commit 12cbb04

Please sign in to comment.