diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2023-03-03 11:16:44 -0700 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2023-03-03 11:16:44 -0700 |
commit | 63aa1cd20a5be07a1d948e3567583c367f4d22f2 (patch) | |
tree | 5945d34660d35f7f9cb8e5c21b53e056a2550c8d | |
parent | 8f387cb9b281a4f9ba68252f0ded3b00ea042593 (diff) | |
download | sudo-63aa1cd20a5be07a1d948e3567583c367f4d22f2.tar.gz |
sudoers_policy_list: do not set runas_pw to list_pw when listing
This change introduced in sudo 1.9.13 is not actually needed. The
"list" pseudo-command checks are performed via runas_matches_pw()
which does not use runas_pw. GitHub issue #248
-rw-r--r-- | plugins/sudoers/policy.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c index 23eb4ae8d..b547693a9 100644 --- a/plugins/sudoers/policy.c +++ b/plugins/sudoers/policy.c @@ -1270,11 +1270,6 @@ sudoers_policy_list(int argc, char * const argv[], int verbose, sudo_warnx(U_("unknown user %s"), list_user); debug_return_int(-1); } - /* A user may only list another user they have runas access to. */ - if (runas_pw != NULL) - sudo_pw_delref(runas_pw); - runas_pw = list_pw; - sudo_pw_addref(list_pw); } ret = sudoers_policy_main(argc, argv, I_LISTPW, NULL, verbose, NULL); if (list_user) { |