PATH contains dot when PATH is unset before running bash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Debian) |
Confirmed
|
Unknown
|
|||
bash (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Won't Fix
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Undecided
|
Unassigned | ||
Eoan |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
* The fallback path built into bash contains '.' which leads to unexpected addition of the current working directory. It should not be there, just like it isnt' in pre-precise and cosmic+.
[Test Case]
* $ env -u PATH /bin/bash -c 'echo $PATH'
Should not have '.' as any component. Nor should there be any empty components, i.e. '::'.
[Regression Potential]
* Normally PATH is always set by either init, systemd, or any other hypervisor. Thus this only affects executions under bash, when it was started without any environment - e.g. booting with 'init=/bin/bash'.
[Other Info]
* Original bug report.
On ubuntu 16.04 (but also 14.04), running bash with PATH unset always adds '.' to PATH:
philippe@
/usr/local/
philippe@
philippe@
philippe@
/usr/local/
Even when testing in a virtual machine / docker, and erasing /root/.profile /root/.bashrc /etc/profile /etc/bash.bashrc the problem still happens.
summary: |
- bash PATH contains dot when PATH is unset + PATH contains dot when PATH is unset before running bash |
affects: | ubuntu → bash (Ubuntu) |
tags: | added: trusyt xenial |
Changed in bash (Ubuntu): | |
importance: | Undecided → Medium |
tags: |
added: trusty removed: trusyt |
description: | updated |
Changed in bash (Ubuntu Eoan): | |
status: | Fix Released → In Progress |
Changed in bash (Ubuntu Cosmic): | |
status: | New → Fix Released |
Changed in bash (Ubuntu Disco): | |
status: | New → In Progress |
Changed in bash (Ubuntu Eoan): | |
status: | In Progress → Fix Committed |
Changed in bash (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in bash (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in bash (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in bash (Ubuntu Precise): | |
status: | New → Fix Released |
Changed in bash (Ubuntu Trusty): | |
status: | In Progress → Won't Fix |
Changed in bash (Debian): | |
status: | Unknown → New |
Changed in bash (Debian): | |
status: | New → Confirmed |
The problem seems to have been introduced in 14.04
philippe@ pv-desktop: ~$ for i in 12.04 12.10 13.04 13.10 14.04 14.10 15.04 15.10 16.04; do echo $i; docker run -it --rm ubuntu:$i bash -c "unset PATH; /bin/bash -c 'echo \$PATH'"; done sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin bin:/usr/ local/sbin: /usr/bin: /usr/sbin: /bin:/sbin: . bin:/usr/ local/sbin: /usr/bin: /usr/sbin: /bin:/sbin: . bin:/usr/ local/sbin: /usr/bin: /usr/sbin: /bin:/sbin: . bin:/usr/ local/sbin: /usr/bin: /usr/sbin: /bin:/sbin: . bin:/usr/ local/sbin: /usr/bin: /usr/sbin: /bin:/sbin: .
12.04
/usr/local/
12.10
/usr/local/
13.04
/usr/local/
13.10
/usr/local/
14.04
/usr/local/
14.10
/usr/local/
15.04
/usr/local/
15.10
/usr/local/
16.04
/usr/local/