[sudo-users] sudo -l semantics
leamas.alec at gmail.com
Fri Dec 27 04:25:20 MST 2013
Having an application using sudo to run some specific commands, I would
like to warn the user if the current configuration doesn't allow her to
do what she want.
sudo -l seems to be designed for this. I could just run "sudo -l <some
command>" and get a yes/no return status.
However, it doesn't work for this purpose(?). If the command isn't
allowed, I get a "sudo password" prompt. I could add a -n flag, which
will give me a return status reflecting if user can run command without
a password. But I can't figure out a way to test if a user can run a
given command with or without a password.
I'm on fedora, sudo version 1.8.6p7.
Any thoughts out there?
More information about the sudo-users