Package: bash
Version: 3.1dfsg-8
Severity: normal
The _known_hosts() function in bash_completion fails if there are
spaces in the path of one of the ssh config files (i.e. in the homedir
of the user). This causes completion to fail (and error messages from
sed to appear) when completing an argument to rsync. This problem can
be fixed by more rigorous quoting. I have a patch (attached).
--Mike
-- System Information:
Debian Release: 4.0
APT prefers testing
APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Versions of packages bash depends on:
ii base-files 4 Debian base system miscellaneous f
ii debianutils 2.17 Miscellaneous utilities specific t
ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries
ii libncurses5 5.5-5 Shared libraries for terminal hand
bash recommends no packages.
-- no debconf information
--- bash_completion.old 2007-03-13 13:30:51.000000000 -0400
+++ bash_completion 2007-03-13 17:43:22.000000000 -0400
@@ -2423,17 +2423,17 @@
# ssh config files
[ -r /etc/ssh/ssh_config ] &&
- config=( [EMAIL PROTECTED] /etc/ssh/ssh_config )
- [ -r ~/.ssh/config ] &&
- config=( [EMAIL PROTECTED] ~/.ssh/config )
- [ -r ~/.ssh2/config ] &&
- config=( [EMAIL PROTECTED] ~/.ssh2/config )
+ config=( "[EMAIL PROTECTED]" "/etc/ssh/ssh_config" )
+ [ -r "${HOME}/.ssh/config" ] &&
+ config=( "[EMAIL PROTECTED]" "${HOME}/.ssh/config" )
+ [ -r "${HOME}/.ssh2/config" ] &&
+ config=( "[EMAIL PROTECTED]" "${HOME}/.ssh2/config" )
if [ [EMAIL PROTECTED] -gt 0 ]; then
# expand path (if present) to global known hosts file
- global_kh=$( eval echo $( sed -ne 's/^[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' [EMAIL PROTECTED] ) )
+ global_kh=$( eval echo $( sed -ne 's/^[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "[EMAIL PROTECTED]" ) )
# expand path (if present) to user known hosts file
- user_kh=$( eval echo $( sed -ne 's/^[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' [EMAIL PROTECTED] ) )
+ user_kh=$( eval echo $( sed -ne 's/^[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "[EMAIL PROTECTED]" ) )
fi
# choose which global known hosts file to use
@@ -2509,7 +2509,8 @@
fi
# append any available aliases from config files
if [ [EMAIL PROTECTED] -gt 0 ] && [ -n "$aliases" ]; then
- hosts=$( compgen -W "$( sed -ne 's/^[Hh][Oo][Ss][Tt]['"$'\t '"']*\([^*?]*\)$/\1/p' [EMAIL PROTECTED] )" -- $ocur )
+ local host_aliases=$( sed -ne 's/^[Hh][Oo][Ss][Tt]['"$'\t '"']*\([^*?]*\)$/\1/p' "[EMAIL PROTECTED]" )
+ hosts=$( compgen -W "$host_aliases" -- $ocur )
COMPREPLY=( [EMAIL PROTECTED] $hosts )
fi