* [gentoo-user] Where does sudo get the PATH ?
@ 2012-10-08 14:20 Nicolas Richard
2012-10-09 5:11 ` J. Roeleveld
2012-10-23 9:26 ` Nicolas Richard
0 siblings, 2 replies; 13+ messages in thread
From: Nicolas Richard @ 2012-10-08 14:20 UTC (permalink / raw
To: gentoo-user
Hi everybody,
I don't understand where sudo finds the value for the PATH env variable.
Here is the output of the relevant (at least I thought they were)
commands. Can somebody explain to me why I still have
/usr/local/texlive/*2011*/bin/i386-linux in the first sudo output ? I
don't get it, and did not find anything in the man page of sudo.
Thanks in advance for your help.
youngfrog@geodiff-mac3 ~ $ bash -c 'echo $PATH'
~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
youngfrog@geodiff-mac3 ~ $ source /etc/profile
youngfrog@geodiff-mac3 ~ $ bash -c 'echo $PATH'
/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux
youngfrog@geodiff-mac3 ~ $ sudo bash -c 'echo $PATH'
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
youngfrog@geodiff-mac3 ~ $ sudo -i bash -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux:/root/bin
youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 /etc
youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 ~root
/root/.bash_history:cd /usr/local/texlive/2011
/root/.bash_history:grep texlive/2011 * -r
/root/.bash_history:grep texlive/2011 . -r
/root/.bash_history:grep texlive/2011 .* -r
youngfrog@geodiff-mac3 ~ $ grep -v '^#\|^$' /etc/environment
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
--
N.R.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Where does sudo get the PATH ?
2012-10-08 14:20 [gentoo-user] Where does sudo get the PATH ? Nicolas Richard
@ 2012-10-09 5:11 ` J. Roeleveld
2012-10-09 15:03 ` [gentoo-user] " Nicolas Richard
2012-10-23 9:26 ` Nicolas Richard
1 sibling, 1 reply; 13+ messages in thread
From: J. Roeleveld @ 2012-10-09 5:11 UTC (permalink / raw
To: gentoo-user
Nicolas Richard <theonewiththeevillook@yahoo.fr> wrote:
>Hi everybody,
>
>I don't understand where sudo finds the value for the PATH env
>variable.
>
>Here is the output of the relevant (at least I thought they were)
>commands. Can somebody explain to me why I still have
>/usr/local/texlive/*2011*/bin/i386-linux in the first sudo output ? I
>don't get it, and did not find anything in the man page of sudo.
>
>Thanks in advance for your help.
>
>youngfrog@geodiff-mac3 ~ $ bash -c 'echo $PATH'
>~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
>
>youngfrog@geodiff-mac3 ~ $ source /etc/profile
>
>youngfrog@geodiff-mac3 ~ $ bash -c 'echo $PATH'
>/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux
>
>youngfrog@geodiff-mac3 ~ $ sudo bash -c 'echo $PATH'
>/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
>
>youngfrog@geodiff-mac3 ~ $ sudo -i bash -c 'echo $PATH'
>/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux:/root/bin
>
>youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 /etc
>
>youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 ~root
>/root/.bash_history:cd /usr/local/texlive/2011
>/root/.bash_history:grep texlive/2011 * -r
>/root/.bash_history:grep texlive/2011 . -r
>/root/.bash_history:grep texlive/2011 .* -r
>
>youngfrog@geodiff-mac3 ~ $ grep -v '^#\|^$' /etc/environment
>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
Nicolas.
I can see several /usr/local/... paths in your /etc/environment.
--
Joost
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-09 5:11 ` J. Roeleveld
@ 2012-10-09 15:03 ` Nicolas Richard
2012-10-10 9:49 ` J. Roeleveld
2012-10-10 9:50 ` J. Roeleveld
0 siblings, 2 replies; 13+ messages in thread
From: Nicolas Richard @ 2012-10-09 15:03 UTC (permalink / raw
To: gentoo-user
>>>>> "Joost" == J Roeleveld <joost@antarean.org> writes:
Joost> Nicolas Richard <theonewiththeevillook@yahoo.fr> wrote:
>> Here is the output of the relevant (at least I thought they were)
>> commands. Can somebody explain to me why I still have
>> /usr/local/texlive/*2011*/bin/i386-linux in the first sudo output
>> youngfrog@geodiff-mac3 ~ $ sudo bash -c 'echo $PATH'
>> /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
>> youngfrog@geodiff-mac3 ~ $ grep -v '^#\|^$' /etc/environment
>> 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
Joost> I can see several /usr/local/... paths in your
Joost> /etc/environment.
Hello Joost,
Yes, I see them too, but they are pointing to the more recent 2012
release of texlive, not the older 2011 one. What I don't understand is
where /sudo/ finds the environment when called without the "-i" option
(and in particular, that entry for texlive 2011). The manpage seems to
say that it simply uses the current environment (quoting the manpage :
"Note, however, that the actual PATH environment variable is not
modified and is passed unchanged to the program that sudo executes.")
but that does not seem right.
--
N.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-09 15:03 ` [gentoo-user] " Nicolas Richard
@ 2012-10-10 9:49 ` J. Roeleveld
2012-10-10 9:50 ` J. Roeleveld
1 sibling, 0 replies; 13+ messages in thread
From: J. Roeleveld @ 2012-10-10 9:49 UTC (permalink / raw
To: gentoo-user
On Tue, October 9, 2012 5:03 pm, Nicolas Richard wrote:
>>>>>> "Joost" == J Roeleveld <joost@antarean.org> writes:
>
> Joost> Nicolas Richard <theonewiththeevillook@yahoo.fr> wrote:
> >> Here is the output of the relevant (at least I thought they were)
> >> commands. Can somebody explain to me why I still have
> >> /usr/local/texlive/*2011*/bin/i386-linux in the first sudo output
>
> >> youngfrog@geodiff-mac3 ~ $ sudo bash -c 'echo $PATH'
> >> /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
>
> >> youngfrog@geodiff-mac3 ~ $ grep -v '^#\|^$' /etc/environment
> >> 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
>
> Joost> I can see several /usr/local/... paths in your
> Joost> /etc/environment.
>
>
> Hello Joost,
>
> Yes, I see them too, but they are pointing to the more recent 2012
> release of texlive, not the older 2011 one. What I don't understand is
> where /sudo/ finds the environment when called without the "-i" option
> (and in particular, that entry for texlive 2011). The manpage seems to
> say that it simply uses the current environment (quoting the manpage :
> "Note, however, that the actual PATH environment variable is not
> modified and is passed unchanged to the program that sudo executes.")
> but that does not seem right.
>
> --
> N.
What do you get with "echo $PATH" when not using sudo?
--
Joost
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-09 15:03 ` [gentoo-user] " Nicolas Richard
2012-10-10 9:49 ` J. Roeleveld
@ 2012-10-10 9:50 ` J. Roeleveld
2012-10-10 14:57 ` Nicolas Richard
1 sibling, 1 reply; 13+ messages in thread
From: J. Roeleveld @ 2012-10-10 9:50 UTC (permalink / raw
To: gentoo-user
On Tue, October 9, 2012 5:03 pm, Nicolas Richard wrote:
>>>>>> "Joost" == J Roeleveld <joost@antarean.org> writes:
>
> Joost> Nicolas Richard <theonewiththeevillook@yahoo.fr> wrote:
> >> Here is the output of the relevant (at least I thought they were)
> >> commands. Can somebody explain to me why I still have
> >> /usr/local/texlive/*2011*/bin/i386-linux in the first sudo output
>
> >> youngfrog@geodiff-mac3 ~ $ sudo bash -c 'echo $PATH'
> >> /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
>
> >> youngfrog@geodiff-mac3 ~ $ grep -v '^#\|^$' /etc/environment
> >> 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
>
> Joost> I can see several /usr/local/... paths in your
> Joost> /etc/environment.
>
>
> Hello Joost,
>
> Yes, I see them too, but they are pointing to the more recent 2012
> release of texlive, not the older 2011 one. What I don't understand is
> where /sudo/ finds the environment when called without the "-i" option
> (and in particular, that entry for texlive 2011). The manpage seems to
> say that it simply uses the current environment (quoting the manpage :
> "Note, however, that the actual PATH environment variable is not
> modified and is passed unchanged to the program that sudo executes.")
> but that does not seem right.
And, what is in the .bash_profile and .bashrc files in your homedir and in
root's homedir?
--
Joost
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-10 9:50 ` J. Roeleveld
@ 2012-10-10 14:57 ` Nicolas Richard
2012-10-10 18:43 ` Joost Roeleveld
0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Richard @ 2012-10-10 14:57 UTC (permalink / raw
To: gentoo-user
>>>>> "Joost" == J Roeleveld <joost@antarean.org> writes:
Joost> And, what is in the .bash_profile and .bashrc files in your
Joost> homedir and in root's homedir?
In my homedir:
.bash_profile loads .bashrc
.bashrc says export PATH="~/bin/overrideglobal:${PATH}:~/bin" (and
defines some aliases)
In root's: I have no such files.
Maybe it would be less distracting if I don't use a shell at all :
youngfrog@geodiff-mac3 ~ $ sudo -i env | grep ^PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux:/root/bin
youngfrog@geodiff-mac3 ~ $ sudo env | grep ^PATH
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
Joost> What do you get with "echo $PATH" when not using sudo?
You mean, when I'm logged in as root ? Then it's the same as when using
sudo -i.
N.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-10 14:57 ` Nicolas Richard
@ 2012-10-10 18:43 ` Joost Roeleveld
2012-10-11 14:25 ` Nicolas Richard
0 siblings, 1 reply; 13+ messages in thread
From: Joost Roeleveld @ 2012-10-10 18:43 UTC (permalink / raw
To: gentoo-user
On Wednesday, October 10, 2012 04:57:50 PM Nicolas Richard wrote:
> >>>>> "Joost" == J Roeleveld <joost@antarean.org> writes:
> Joost> And, what is in the .bash_profile and .bashrc files in your
> Joost> homedir and in root's homedir?
>
> In my homedir:
> .bash_profile loads .bashrc
> .bashrc says export PATH="~/bin/overrideglobal:${PATH}:~/bin" (and
> defines some aliases)
Does it load any global default?
> In root's: I have no such files.
>
> Maybe it would be less distracting if I don't use a shell at all :
>
> youngfrog@geodiff-mac3 ~ $ sudo -i env | grep ^PATH
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/
> usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux:/
> root/bin
>
> youngfrog@geodiff-mac3 ~ $ sudo env | grep ^PATH
> PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/
> usr/local/texlive/2011/bin/i386-linux
>
>
> Joost> What do you get with "echo $PATH" when not using sudo?
>
> You mean, when I'm logged in as root ? Then it's the same as when using
> sudo -i.
No, when you're logged in as your normal user.
In other words, what is in the environment when you are normally logged in?
--
Joost
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-10 18:43 ` Joost Roeleveld
@ 2012-10-11 14:25 ` Nicolas Richard
2012-10-11 16:24 ` Pandu Poluan
0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Richard @ 2012-10-11 14:25 UTC (permalink / raw
To: gentoo-user
Joost Roeleveld <joost@antarean.org> writes:
> On Wednesday, October 10, 2012 04:57:50 PM Nicolas Richard wrote:
>> In my homedir:
>> .bash_profile loads .bashrc
>> .bashrc says export PATH="~/bin/overrideglobal:${PATH}:~/bin" (and
>> defines some aliases)
>
> Does it load any global default?
No. Here are the full files, omitting comments and empty lines :
youngfrog@geodiff-mac3 ~ $ grep -vH '^#\|^$' .bashrc .bash_profile
.bashrc:export PATH="~/bin/overrideglobal:${PATH}:~/bin"
.bashrc:if [[ $- != *i* ]] ; then
.bashrc: # Shell is non-interactive. Be done now!
.bashrc: return
.bashrc:fi
.bashrc:UPDATEGITREPO="~/TeX/ ~/BSSM/2011/notes-de-conf/ ~/org/ ~/BSSM/2012"
.bashrc:export UPDATEGITREPO
.bashrc:alias ll="ls -lA"
.bashrc:alias l="ls -CF"
.bashrc:alias cp="cp -i"
.bashrc:alias rm="rm -i"
.bashrc:alias mv="mv -i"
.bash_profile:[[ -f ~/.bashrc ]] && . ~/.bashrc
> In other words, what is in the environment when you are normally
> logged in?
Ok, I thought my original post contained it. In fact that was part of my
original post :
youngfrog@geodiff-mac3 ~ $ bash -c 'echo $PATH'
~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
and I forgot to mention that it was the same as :
youngfrog@geodiff-mac3 ~ $ env | grep ^PATH
PATH=~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
and yet the same as :
youngfrog@geodiff-mac3 ~ $ echo $PATH
~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
Thanks for trying btw. I certainly did something really stupid to set
the path the first time, but can't see where.
N.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-11 14:25 ` Nicolas Richard
@ 2012-10-11 16:24 ` Pandu Poluan
2012-10-11 16:50 ` Nicolas Richard
0 siblings, 1 reply; 13+ messages in thread
From: Pandu Poluan @ 2012-10-11 16:24 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2092 bytes --]
On Oct 11, 2012 9:29 PM, "Nicolas Richard" <theonewiththeevillook@yahoo.fr>
wrote:
>
> Joost Roeleveld <joost@antarean.org> writes:
> > On Wednesday, October 10, 2012 04:57:50 PM Nicolas Richard wrote:
> >> In my homedir:
> >> .bash_profile loads .bashrc
> >> .bashrc says export PATH="~/bin/overrideglobal:${PATH}:~/bin" (and
> >> defines some aliases)
> >
> > Does it load any global default?
>
> No. Here are the full files, omitting comments and empty lines :
>
> youngfrog@geodiff-mac3 ~ $ grep -vH '^#\|^$' .bashrc .bash_profile
> .bashrc:export PATH="~/bin/overrideglobal:${PATH}:~/bin"
> .bashrc:if [[ $- != *i* ]] ; then
> .bashrc: # Shell is non-interactive. Be done now!
> .bashrc: return
> .bashrc:fi
> .bashrc:UPDATEGITREPO="~/TeX/ ~/BSSM/2011/notes-de-conf/ ~/org/
~/BSSM/2012"
> .bashrc:export UPDATEGITREPO
> .bashrc:alias ll="ls -lA"
> .bashrc:alias l="ls -CF"
> .bashrc:alias cp="cp -i"
> .bashrc:alias rm="rm -i"
> .bashrc:alias mv="mv -i"
> .bash_profile:[[ -f ~/.bashrc ]] && . ~/.bashrc
>
> > In other words, what is in the environment when you are normally
> > logged in?
>
> Ok, I thought my original post contained it. In fact that was part of my
> original post :
>
> youngfrog@geodiff-mac3 ~ $ bash -c 'echo $PATH'
>
~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
>
> and I forgot to mention that it was the same as :
> youngfrog@geodiff-mac3 ~ $ env | grep ^PATH
>
PATH=~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
>
> and yet the same as :
> youngfrog@geodiff-mac3 ~ $ echo $PATH
>
~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
>
> Thanks for trying btw. I certainly did something really stupid to set
> the path the first time, but can't see where.
>
A bit desperate, but try :
grep -R "texlive/2011" /etc/*
Rgds,
[-- Attachment #2: Type: text/html, Size: 2784 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-11 16:24 ` Pandu Poluan
@ 2012-10-11 16:50 ` Nicolas Richard
2012-10-11 17:24 ` Pandu Poluan
0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Richard @ 2012-10-11 16:50 UTC (permalink / raw
To: gentoo-user
Pandu Poluan <pandu@poluan.info> writes:
> A bit desperate, but try :
>
> grep -R "texlive/2011" /etc/*
I tried that already
youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 /etc
youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 ~root
/root/.bash_history:cd /usr/local/texlive/2011
/root/.bash_history:grep texlive/2011 * -r
/root/.bash_history:grep texlive/2011 . -r
/root/.bash_history:grep texlive/2011 .* -r
--
N.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-11 16:50 ` Nicolas Richard
@ 2012-10-11 17:24 ` Pandu Poluan
2012-10-12 8:55 ` Nicolas Richard
0 siblings, 1 reply; 13+ messages in thread
From: Pandu Poluan @ 2012-10-11 17:24 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 726 bytes --]
On Oct 11, 2012 11:54 PM, "Nicolas Richard" <theonewiththeevillook@yahoo.fr>
wrote:
>
> Pandu Poluan <pandu@poluan.info> writes:
> > A bit desperate, but try :
> >
> > grep -R "texlive/2011" /etc/*
>
> I tried that already
>
> youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 /etc
>
> youngfrog@geodiff-mac3 ~ $ sudo grep -r texlive/2011 ~root
> /root/.bash_history:cd /usr/local/texlive/2011
> /root/.bash_history:grep texlive/2011 * -r
> /root/.bash_history:grep texlive/2011 . -r
> /root/.bash_history:grep texlive/2011 .* -r
>
> --
> N.
>
>
Hmmmmmm....
Maybe it's building the PATH not explicitly... something like :
PATH="$PATH;/usr/local/texlive/$SOME_VARIABLE/and/so/forth"
Try grepping for "texlive/\$"
Rgds,
[-- Attachment #2: Type: text/html, Size: 1071 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-11 17:24 ` Pandu Poluan
@ 2012-10-12 8:55 ` Nicolas Richard
0 siblings, 0 replies; 13+ messages in thread
From: Nicolas Richard @ 2012-10-12 8:55 UTC (permalink / raw
To: gentoo-user
Pandu Poluan <pandu@poluan.info> writes:
> Maybe it's building the PATH not explicitly... something like :
>
> PATH="$PATH;/usr/local/texlive/$SOME_VARIABLE/and/so/forth"
>
> Try grepping for "texlive/\$"
I tried, but the results are always pointing to the (correct) 2012
version.
I paste the result hereunder just in case, but I'm pretty sure there's
nothing interesting in there. (btw, there are errors because of missing
targets for some symlinks, hence the redirection)
youngfrog@geodiff-mac3 /etc $ sudo grep -R 'texlive' * 2> /dev/null
csh.env:setenv INFOPATH '/usr/share/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.5.4/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.22/info:/usr/share/info/emacs-24:/usr/local/texlive/2012/texmf/doc/info'
csh.env:setenv MANPATH '/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.5.4/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.22/man:/etc/java-config/system-vm/man/:/usr/local/texlive/2012/texmf/doc/man'
csh.env:setenv PATH '/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux'
csh.env:setenv ROOTPATH '/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux'
env.d/99texlive:PATH=/usr/local/texlive/2012/bin/i386-linux
env.d/99texlive:ROOTPATH=/usr/local/texlive/2012/bin/i386-linux
env.d/99texlive:MANPATH=/usr/local/texlive/2012/texmf/doc/man
env.d/99texlive:INFOPATH=/usr/local/texlive/2012/texmf/doc/info
environment: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
portage/profile/package.provided:app-text/texlive-core-2011-r5
portage/profile/package.provided:dev-texlive/texlive-basic-2011-r1
portage/profile/package.provided:dev-texlive/texlive-documentation-base-2011
portage/profile/package.provided:dev-texlive/texlive-fontsextra-2011
portage/profile/package.provided:dev-texlive/texlive-fontsrecommended-2011
portage/profile/package.provided:dev-texlive/texlive-fontutils-2011
portage/profile/package.provided:dev-texlive/texlive-genericextra-2011
portage/profile/package.provided:dev-texlive/texlive-genericrecommanded-2011
portage/profile/package.provided:dev-texlive/texlive-genericrecommended-2011
portage/profile/package.provided:dev-texlive/texlive-latex-2011
portage/profile/package.provided:dev-texlive/texlive-latexextra-2011-r2
portage/profile/package.provided:dev-texlive/texlive-latexrecommended-2011
portage/profile/package.provided:dev-texlive/texlive-pictures-2011
portage/profile/package.provided:dev-texlive/texlive-pstricks-2011
portage/profile/package.provided:dev-texlive/texlive-science-2011
portage/profile/package.provided:dev-texlive/texlive-texinfo-2011
portage/profile/package.provided:# dev-texlive/texlive-latex3-2011
portage/profile/package.provided:# dev-texlive/texlive-fontsextra-2011
portage/profile/package.provided:# dev-texlive/texlive-latexextra-2011
portage/profile/package.provided:# dev-texlive/texlive-pictures-2011
portage/profile/package.provided:# dev-texlive/texlive-science-2011
portage/profile/package.provided:# dev-texlive/texlive-xetex-2011
portage/profile/package.provided:# dev-texlive/texlive-luatex-2011
prelink.conf:-h /usr/local/texlive/2012/bin/i386-linux/
profile.env:export INFOPATH='/usr/share/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.5.4/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.22/info:/usr/share/info/emacs-24:/usr/local/texlive/2012/texmf/doc/info'
profile.env:export MANPATH='/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.5.4/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.22/man:/etc/java-config/system-vm/man/:/usr/local/texlive/2012/texmf/doc/man'
profile.env:export PATH='/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux'
profile.env:export ROOTPATH='/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux'
--
N.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] Re: Where does sudo get the PATH ?
2012-10-08 14:20 [gentoo-user] Where does sudo get the PATH ? Nicolas Richard
2012-10-09 5:11 ` J. Roeleveld
@ 2012-10-23 9:26 ` Nicolas Richard
1 sibling, 0 replies; 13+ messages in thread
From: Nicolas Richard @ 2012-10-23 9:26 UTC (permalink / raw
To: gentoo-user
"Nicolas Richard" <theonewiththeevillook@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.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-10-23 9:28 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-08 14:20 [gentoo-user] Where does sudo get the PATH ? Nicolas Richard
2012-10-09 5:11 ` J. Roeleveld
2012-10-09 15:03 ` [gentoo-user] " Nicolas Richard
2012-10-10 9:49 ` J. Roeleveld
2012-10-10 9:50 ` J. Roeleveld
2012-10-10 14:57 ` Nicolas Richard
2012-10-10 18:43 ` Joost Roeleveld
2012-10-11 14:25 ` Nicolas Richard
2012-10-11 16:24 ` Pandu Poluan
2012-10-11 16:50 ` Nicolas Richard
2012-10-11 17:24 ` Pandu Poluan
2012-10-12 8:55 ` Nicolas Richard
2012-10-23 9:26 ` Nicolas Richard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox