From 91a48d991009fadf43ce2e45fe288c78298b583c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 18 May 2008 14:47:25 +0200 Subject: [PATCH] Filter out non-existing host names Otherwise ssh-keyscan will fail completely if there is one non-existing host on the command line. --- dowkd.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dowkd.in b/dowkd.in index e540988..a1b608c 100644 --- a/dowkd.in +++ b/dowkd.in @@ -281,6 +281,13 @@ sub from_openvpn_key ($) { sub from_ssh_host (@) { my @names = @_; + + @names = grep { + my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname $_; + @addrs or warn "warning: host not found: $_\n"; + @addrs > 0; + } @names; + my @lines; push @lines, safe_backtick qw/ssh-keyscan -t rsa/, @names; push @lines, safe_backtick qw/ssh-keyscan -t dsa/, @names; -- 2.11.4.GIT