[sudo-users] sudo and wildcards in the command line

Stier, Matthew Matthew.Stier at us.fujitsu.com
Mon Jun 7 06:55:22 EDT 2010


Because shell wildcards are expanded before the command is executed.  In your example, the first wildcard expansion is done using your account, and your permissions. The second wildcard expansion is being done as root, who has sufficient permissions to access /home, /home/user, and /home/user/.history.


-----Original Message-----
From: sudo-users-bounces at courtesan.com [mailto:sudo-users-bounces at courtesan.com] On Behalf Of Jackson
Sent: Monday, June 07, 2010 4:39 AM
To: sudo-users at sudo.ws
Subject: [sudo-users] sudo and wildcards in the command line

Hello everyone,

This is regarding the way sudo interprets wildcards in the command line.
I´m using sudo 1.6.9.20 on AIX 6.1 and when I use, i.e. ls to list the contents of a directory that doesn´t belong to me, I get the following:

$ sudo ls -l /home/user/.history/.sudo_*
ls: 0653-341 The file /home/user/.history/.sudo_* does not exist..

But if I inform the full path of the file I can see it:

$ sudo ls -l /home/user/.history/.sudo_wildcard_test.txt
-rw-r--r--    1 root     system            0 Jun 07 08:29 /home/user/.history/.sudo_wildcard_test.txt

If I run the first command as root it works:

# ls -l /home/user/.history/.sudo_*
-rw-r--r--    1 root     system            0 Jun 07 08:29 /home/user/.history/.sudo_wildcard_test.txt

Is this fixed on newer versions of sudo? Is there anything that I can change in the configuration file to make it work?

Thanks in advance,

Jackson



      
____________________________________________________________ 
sudo-users mailing list <sudo-users at sudo.ws>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-users



More information about the sudo-users mailing list