Prevent root PATH expansion proliferating
The PATH expansion done in `_root_command()': PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3 stayed effective with bash >= 4.1.4 running in posix mode, causing PATH to grow ever larger when doing sudo completions. This is now fixed. To run the automated test: ./run ./completion/sudo.exp See also: - http://www.mail-archive.com/bug-bash@gnu.org/msg06942.html - bash patch: bash41-004master
parent
9db025c708
commit
876c8e26c1
|
@ -1729,7 +1729,8 @@ complete -F _command -o filenames nohup exec nice eval time ltrace then \
|
|||
|
||||
_root_command()
|
||||
{
|
||||
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3
|
||||
local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
||||
_command $1 $2 $3
|
||||
}
|
||||
complete -F _root_command -o filenames sudo fakeroot really gksudo gksu kdesudo
|
||||
|
||||
|
|
Loading…
Reference in New Issue