Skip to content

Commit 876c8e2

Browse files
committed
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-004
1 parent 9db025c commit 876c8e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bash_completion

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,8 @@ complete -F _command -o filenames nohup exec nice eval time ltrace then \
17291729

17301730
_root_command()
17311731
{
1732-
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3
1732+
local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
1733+
_command $1 $2 $3
17331734
}
17341735
complete -F _root_command -o filenames sudo fakeroot really gksudo gksu kdesudo
17351736

0 commit comments

Comments
 (0)