[sudo-users] Sudo keeps using the same binary although PATH is different when invoking with sudo.

Todd C. Miller Todd.Miller at courtesan.com
Tue Mar 4 09:56:08 MST 2014

On Mon, 03 Mar 2014 21:30:59 +0000, Piotr Dobrogost wrote:

> [user at localhost ~]$ env | grep PATH
> PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/user
> /bin
> [user at localhost ~]$ sudo env | grep PATH
> PATH=/usr/bin:/bin

That's odd, I wonder if PAM is setting the PATH.

> Yet it seems it does modify PATH as seen in the output from `env` above.
> Any ideas? Is it possible that this version of sudo was compiled with
> secure_path but information about this is missig both in the output of sudo
> -l and sudo -V? Below is the output of sudo sudo -V:

If it is not in the "sudo -V" output or the sudoers file then I
don't think secure_path is set.  Furthermore, secure_path also
affects the search path when sudo looks for an unqualified command
to run and that doesn't appear to be happening.

Based on your sudoers file I'm guessing that you are running
the sudo that comes with RHEL 5.  Is that correct?

 - todd

More information about the sudo-users mailing list