Bugzilla – Bug 164
sudo ls wildcard bug
Last modified: 2004-12-30 00:00:45 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
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.