Public bug reported:
Binary package hint: bash
When you are dropped into a single-user root shell, such as when fsck
has failed during boot, the shell runs with a minimal PATH which does
not include /usr/bin
Yet, there are commands from /usr/bin which are being invoked from
/root/.bashrc
The code has a check for the case when /usr is not mounted; but this is
not sufficient. It should either use the full path when it actually
invokes a command in /usr/bin, or not run these commands when /usr is
not mounted. (I would somehow prefer the latter, as they are generally
"sugar candy" which is not directly useful in a root shell / rescue disk
scenario.)
vnix$ PATH=/sbin:/bin:/usr/games
vnix$ vnix$ lesspipe
Command 'lesspipe' is available in '/usr/bin/lesspipe'
The command could not be located because '/usr/bin' is not included in the PATH
environment variable.
bash: lesspipe: command not found
vnix$ fgrep lesspipe /root/.bashrc
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
vnix$ ls -l /usr/bin/lesspipe
-rwxr-xr-x 1 root root 6507 2007-07-20 14:36 /usr/bin/lesspipe
vnix$ [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
bash: lesspipe: command not found
bash: Command: command not found
bash: The: command not found
vnix$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"
This is also tangentially related to bug #121992
** Affects: bash (Ubuntu)
Importance: Undecided
Status: New
--
/root/.bashrc might be invoked without /usr/bin in PATH
https://bugs.launchpad.net/bugs/212413
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs