Skip to content

Commit

Permalink
role_to_sudoers: only try to reuse a privilege if one is present
Browse files Browse the repository at this point in the history
  • Loading branch information
millert committed Nov 2, 2023
1 parent 1a11be4 commit 2ffcda8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/sudoers/parse_ldif.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ role_to_sudoers(struct sudoers_parse_tree *parse_tree, struct sudo_role *role,
U_("unable to allocate memory"));
}

if (reuse_privilege) {
if (reuse_privilege && !TAILQ_EMPTY(&us->privileges)) {
/* Hostspec unchanged, append cmndlist to previous privilege. */
struct privilege *prev_priv = TAILQ_LAST(&us->privileges, privilege_list);
if (reuse_runas) {
Expand Down

0 comments on commit 2ffcda8

Please sign in to comment.