Bug 110 - Cannot run /usr/local/bin/lsof -i -n -P -u^root,^oracle,^www,^sniff" with sudo
Cannot run /usr/local/bin/lsof -i -n -P -u^root,^oracle,^www,^sniff" with sudo
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.6
HP HP-UX
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-30 06:52 MDT by Michael Kelly
Modified: 2004-05-12 18:55 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Kelly 2003-04-30 06:52:59 MDT
My /etc/sudoers file contains the lines
Cmnd_Alias LSOFU=/usr/local/bin/lsof -i -n -P -u"^root\,^oracle\,^www\,^sniff"
%dci_asl_dev  ALL=NOPASSWD: LSOFU

sudo -l reports
You may run the following commands on this host:
    (root) NOPASSWD: /usr/local/bin/lsof -i -n -P -u"^root,^oracle,^www,^sniff"

but when I try to run
sudo /usr/local/bin/lsof -i -n -P -u"^root,^oracle,^www,^sniff"

I get
Password:
Sorry, user mkelly is not allowed to execute "/usr/local/bin/lsof -i -n -P -
u^root,^oracle,^www,^sniff" as root on **************.

If I change the command to just "/usr/local/bin/lsof -i -n -P" it works OK.
Comment 1 Todd C. Miller 2004-05-12 14:55:31 MDT
Looks like your shell is eating the double quotes, try escaping them with a
backslash.