"Nicolas Richard" <theonewiththeevill...@yahoo.fr> writes: > I don't understand where sudo finds the value for the PATH env > variable.
Finally, I found where the problem lied. Recall that my problem was the following : I had a path in `sudo env | grep ^PATH' which did not seem to originate from any config file in /etc or /root (the path pointing to texlive/2011). And indeed, it was set at compile time, using --with-secure-path : $ sudo sudo -V | head -2 Sudo version 1.8.5p2 Configure options: --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-zlib=system --with-secure-path=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux --with-editor=/usr/libexec/editor --with-env-editor --without-insults --without-all-insults --with-ldap_conf_file=/etc/ldap.conf.sudo --with-ldap --enable-nls --with-pam --without-skey --without-selinux --without-opie --without-linux-audit --with-timedir=/var/db/sudo --with-plugindir=/usr/lib/sudo --docdir=/usr/share/doc/sudo-1.8.5_p2 In the ebuild, I find the following comment : # FIXME: secure_path is a compile time setting. using ROOTPATH # is not perfect, env-update may invalidate this, but until it # is available as a sudoers setting this will have to do. I'm not sure I understand this comment because adding the following line in /etc/sudoers : Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" does what I expect it to do : override the PATH variable. Maybe the comment is simply outdated ? Thanks to those who tried to help me here and also to Nicolas George who pointed me in the direction of `secure_path' which I had somehow overlooked in the manpages. -- Nicolas.