[sudo-users] sudo can't find an executable in my $PATH!

Kārlis Repsons repsons at gmail.com
Mon Nov 3 09:12:09 EST 2008


On Sunday 02 November 2008 19:59:40 you wrote:
> In message <200811011843.16809.repsons at gmail.com>
>
> 	so spake =?utf-8?q?K=C4=81rlis_Repsons?= (repsons):
> > I was doing more "research" on the problem and it is in the fact,
> > that $PATH variable gets modified by sudo! I set sudoers to preserve
> > PATH, but no good.
> >
> > env and "sudo env" gives me different things! Why is that?
>
> Sudo will remove some potentially dangerous variables from the
> environment, as described in the manual.  However, it does not
> modify PATH unless configured to do so at compile time via the
> --with-ignore-dot and/or --with-secure-path configure options.
>
> It is possible that your vendor has enabled the secure path option,
> in which case sudo will only look for commands in a hard-coded path.
> You can run "sudo sudo -V | grep PATH" and see if there is a line
> in the output similar to:
>
>     Value to override user's $PATH with: /usr/bin:/usr/sbin
>
> If so, the mystery is solved.  Unfortunately, there is no way
> to override this value at runtime, though you can certainly
> rebuild sudo without secure path enabled.
>
>  - todd

Thank you man!
You was right, gentoo has --with-secure-path! Grrr... Bugzilla is my next bus 
stop (should be an USE flag for that).

-- 
Kārlis Repsons



More information about the sudo-users mailing list