Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Where does sudo get the PATH ?
Date: Wed, 10 Oct 2012 09:51:09
Message-Id: d1f906475f836177789dbd15c901bc6a.squirrel@www.antarean.org
In Reply to: [gentoo-user] Re: Where does sudo get the PATH ? by Nicolas Richard
1 On Tue, October 9, 2012 5:03 pm, Nicolas Richard wrote:
2 >>>>>> "Joost" == J Roeleveld <joost@××××××××.org> writes:
3 >
4 > Joost> Nicolas Richard <theonewiththeevillook@×××××.fr> wrote:
5 > >> Here is the output of the relevant (at least I thought they were)
6 > >> commands. Can somebody explain to me why I still have
7 > >> /usr/local/texlive/*2011*/bin/i386-linux in the first sudo output
8 >
9 > >> youngfrog@geodiff-mac3 ~ $ sudo bash -c 'echo $PATH'
10 > >> /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
11 >
12 > >> youngfrog@geodiff-mac3 ~ $ grep -v '^#\|^$' /etc/environment
13 > >> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.3:/usr/local/texlive/2012/bin/i386-linux:/root/bin
14 >
15 > Joost> I can see several /usr/local/... paths in your
16 > Joost> /etc/environment.
17 >
18 >
19 > Hello Joost,
20 >
21 > Yes, I see them too, but they are pointing to the more recent 2012
22 > release of texlive, not the older 2011 one. What I don't understand is
23 > where /sudo/ finds the environment when called without the "-i" option
24 > (and in particular, that entry for texlive 2011). The manpage seems to
25 > say that it simply uses the current environment (quoting the manpage :
26 > "Note, however, that the actual PATH environment variable is not
27 > modified and is passed unchanged to the program that sudo executes.")
28 > but that does not seem right.
29
30 And, what is in the .bash_profile and .bashrc files in your homedir and in
31 root's homedir?
32
33
34 --
35 Joost

Replies

Subject Author
[gentoo-user] Re: Where does sudo get the PATH ? Nicolas Richard <theonewiththeevillook@×××××.fr>