Bug 164

Summary: sudo ls wildcard bug
Product: Sudo Reporter: Toby Foote <sudo>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: normal    
Version: 1.6.7   
Hardware: IBM   
OS: AIX   

Description Toby Foote 2004-12-29 12:27:17 MST
Assumptions:
1) A file called /etc/security/passwd exists with 700 access.
2) Running Sudo version 1.6.7p5 on AIX 5100-03

--------------------------

When I run "sudo ls -l /etc/security/p*", I get an error:
ls: 0653-341 The file /etc/security/p* does not exist.

When I run "sudo ls -l /etc/security", this command runs successfully.

It appears that when I use a wildcard, an error occurs.  Can you provide any 
insight to this bug/feature?

Thanks,
Toby Foote
sudo@tobyfoote.com
Comment 1 Todd C. Miller 2004-12-29 20:00:45 MST
Unlike DOS or Windoes, in Unix wilcard expansion is done by your shell, not the individual application. 
 Thus any wildcards should have been expanded before sudo is even run and this is done as the 
regular user and not root (or whatever user you are asking sudo to run things as).  If you quote the 
wildcards it prevents the shell from expanding then and ls will give an error like what you submitted.  
Sudo's wildcard support is limited to matching a given command to entries in the sudoers file itself.