Cmnd_Alias and accessing sub-directories

Todd C. Miller Todd.Miller at
Sun Jul 30 14:32:20 EDT 2000

Whoops, I spoke to soon.  It seems to work just fine for me (I had
made a typo).  The way things work is that slashes must match
exactly in the pathname of the command but they are treated just
as normal characters in the command arguments.  For instance, given

Cmnd_Alias	ICKY = /usr/bin/vi /tmp/[A-z]*/foo
millert		ALL = ICKY

Use millert is able to run vi on files named foo in a subdir
of /tmp.

xerxes [~] % sudo -l
User millert may run the following commands on this host:
    (root) /usr/bin/vi /tmp/[A-z]*/foo

And things like:

xerxes [~] % sudo vi /tmp/jsd/foo

work, as does:

xerxes [~] % sudo vi /tmp/there/we/go/foo

This is using sudo 1.6.3p4.

 - todd

More information about the sudo-users mailing list