Skip to content

Commit

Permalink
confd: fix check for group membership
Browse files Browse the repository at this point in the history
Checking if a user is an administratr we cannot rely solely on the
return value of sr_get_items() but also ensure at least one group
matches the search criteria.

Fixes #469

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit authored and wkz committed Jun 3, 2024
1 parent 2218901 commit 50e068e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/confd/src/ietf-system.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,8 @@ static int change_nacm(sr_session_ctx_t *session, uint32_t sub_id, const char *m
continue; /* not found, this is OK */

/* At least one group grants full administrator permissions */
is_admin = true;
if (rule_count > 0)
is_admin = true;

sr_free_values(rules, rule_count);
}
Expand Down

0 comments on commit 50e068e

Please sign in to comment.