Account for multiple ssh host definitions

Account for multiple host definitions within ssh configuration file - see tracker 2888789
This commit is contained in:
Duncan Ferguson 2009-11-24 09:21:38 +00:00
parent d604feee25
commit b39e649ab3
2 changed files with 4 additions and 1 deletions

View file

@ -2,6 +2,8 @@
* Look for usernames when adding clusters
- Thanks to Kristian Lyngstol for the patch
* Account for multiple host definitions within ssh configuration file
- Thanks to anonymous for the patch
2009-09-24 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.27

View file

@ -433,7 +433,8 @@ sub check_ssh_hostnames {
if ( -r $ssh_config && open( SSHCFG, "<", $ssh_config ) ) {
while (<SSHCFG>) {
next unless (m/^\s*host\s+([\w\.-]+)/i);
$ssh_hostnames{$1} = 1;
# account for multiple declarations of hosts
$ssh_hostnames{$_} = 1 foreach (split(/\s+/, $1) );
}
close(SSHCFG);
}