From 876c8e26c162edfa2c24cc298bbe7ed3123d8eb7 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Wed, 26 May 2010 22:57:08 +0200 Subject: [PATCH] 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 --- bash_completion | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 4aded0d2..27ad6137 100644 --- a/bash_completion +++ b/bash_completion @@ -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