Ubuntu

$PATH is taken from login.defs not /etc/environment

Reported by James Troup on 2012-04-17
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
shadow (Ubuntu)
Medium
Canonical Foundations Team
Precise
Medium
Canonical Foundations Team

Bug Description

$PATH isn't sourced from /etc/environment, instead the version in
/etc/login.defs is used. (The example below comes from a precise install.)

| james@panlong:~$ echo $PATH
| /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
| james@panlong:~$ sudo su - buildd
| buildd@panlong:~$ echo $PATH
| /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
| buildd@panlong:~$ cat /etc/environment
| PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
| buildd@panlong:~$ grep PATH /etc/login.defs
| # Three items must be defined: MAIL_DIR, ENV_SUPATH, and ENV_PATH.
| # *REQUIRED* The default PATH settings, for superuser and normal users.
| ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
| ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
| #CRACKLIB_DICTPATH
| buildd@panlong:~$ sudo sed -i -e "s#^ENV_PATH.*#ENV_PATH PATH=/wtf:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games#" /etc/login.defs
| buildd@panlong:~$ logout
| james@panlong:~$ sudo su - buildd
| buildd@panlong:~$ echo $PATH
| /wtf:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
| buildd@panlong:~$

Steve Langasek (vorlon) on 2012-04-17
Changed in shadow (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Adam Conrad (adconrad) on 2012-06-15
Changed in shadow (Ubuntu Precise):
status: New → Triaged
assignee: nobody → Canonical Foundations Team (canonical-foundations)
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers