Bug 110

Summary: Cannot run /usr/local/bin/lsof -i -n -P -u^root,^oracle,^www,^sniff" with sudo
Product: Sudo Reporter: Michael Kelly <mkelly>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: normal    
Version: 1.6.6   
Hardware: HP   
OS: HP-UX   

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.