Skip to content

Commit 2ffcda8

Browse files
committed
role_to_sudoers: only try to reuse a privilege if one is present
1 parent 1a11be4 commit 2ffcda8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugins/sudoers/parse_ldif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ role_to_sudoers(struct sudoers_parse_tree *parse_tree, struct sudo_role *role,
427427
U_("unable to allocate memory"));
428428
}
429429

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

0 commit comments

Comments
 (0)