sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.16k stars 208 forks source link

`sudo -l -U someuser` fails when given command to check #248

Closed tik-stbuehler closed 1 year ago

tik-stbuehler commented 1 year ago

Given this entry:

nobody ALL = (root) NOPASSWD: /usr/bin/ping

As root: sudo -l -U nobody includes the command in the output, but sudo -l -U nobody /usr/bin/ping fails.

This got broken in 9f695f0fcc749b3cdebc453ba4fdeae84114f3ae (#134).

I think the idea was to check whether the user running this is allowed to run the pseudo command list as the target user, but runas_pw should only be set this way when testing for list, not when searching for the actual command.

millert commented 1 year ago

Fixed in 1.9.13p3