[sudo-users] Sudo keeps using the same binary although PATH is different when invoking with sudo.
p at gmane-2014.dobrogost.net
Sat Mar 1 12:12:25 MST 2014
I have to versions of 'python' binary:
[user at localhost ~]$ which -a python
[user at localhost ~]$ /usr/local/bin/python -V && /usr/bin/python -V
Using sudo modifies PATH as follows:
[user at localhost ~]$ echo 'echo $PATH' | sh && echo 'echo $PATH' | sudo sh
Without sudo the first version on the PATH is used:
[user at localhost ~]$ python -V
However with sudo, seeing as the PATH gets modified as showed above, I
expected /usr/bin/python to be run not /usr/local/bin/python but it seems
like it's not the case:
[user at localhost ~]$ sudo python -V
What am I missing?
More information about the sudo-users