Remove eval() and sed quoting in _known_hosts() (Alioth: #311595)

Fixes execution (!!!) of hosts specified by {Global,User}KnownHosts
    in SSH config files.
This commit is contained in:
David Paleino 2009-04-13 17:10:41 +02:00
parent a17930f8dd
commit a9994ac15f
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@ bash-completion (1.x)
[ David Paleino ]
* Permit .gz files concatenation (Debian: #514377)
* Remove eval() and sed quoting in _known_hosts(), fixes execution (!!!)
of hosts specified by {Global,User}KnownHosts in SSH config files
(Alioth: #311595)
[ Ville Skyttä ]
* Split yum and yum-arch completion into contrib/yum.

View File

@ -2680,9 +2680,9 @@ _known_hosts()
if [ ${#config[@]} -gt 0 ]; then
# expand path (if present) to global known hosts file
global_kh=$( eval echo "$( sed -ne 's/^[ \t]*[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" )" )
global_kh=$( echo $( sed -ne 's/^[ \t]*[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" ) )
# expand path (if present) to user known hosts file
user_kh=$( eval echo "$( sed -ne 's/^[ \t]*[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" )" )
user_kh=$( echo $( sed -ne 's/^[ \t]*[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" ) )
fi
# Global known_hosts files