X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fssh-security.c;h=229c4b40811b1d36ee3b36c88f2c7cd3286ab258;hb=1bb8b17cbd322ed6ab506918446390678b792738;hp=45a55e40d7d2684d299714d8354a33cabf1510da;hpb=94a044f90357edefa6f4ae9f0b1d5885b0e34aee;p=debian%2Famanda diff --git a/common-src/ssh-security.c b/common-src/ssh-security.c index 45a55e4..229c4b4 100644 --- a/common-src/ssh-security.c +++ b/common-src/ssh-security.c @@ -106,6 +106,7 @@ ssh_connect( void * arg, void * datap) { + int result; struct sec_handle *rh; char *amandad_path=NULL, *client_username=NULL, *ssh_keys=NULL; @@ -121,10 +122,13 @@ ssh_connect( rh->ev_timeout = NULL; rh->rc = NULL; + /* get the canonical hostname */ rh->hostname = NULL; - if (resolve_hostname(hostname, 0, NULL, &rh->hostname) || rh->hostname == NULL) { + if ((result = resolve_hostname(hostname, 0, NULL, &rh->hostname)) != 0 + || rh->hostname == NULL) { security_seterror(&rh->sech, - _("%s: ssh could not resolve hostname"), hostname); + _("ssh_security could not find canonical name for '%s': %s"), + hostname, gai_strerror(result)); (*fn)(arg, &rh->sech, S_ERROR); return; }