From 67fc215badd8535cee970d83424b03baed1c57f9 Mon Sep 17 00:00:00 2001 From: halex <> Date: Mon, 23 Mar 2015 22:29:32 +0000 Subject: Make rcmdsh(3) not fail if it is passed a non resolvable hostname. Instead, silently ignore the fact and instead let the underlying ssh (or $RSH) command handle it. ok millert@ --- src/lib/libc/net/rcmdsh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/lib/libc/net/rcmdsh.c') diff --git a/src/lib/libc/net/rcmdsh.c b/src/lib/libc/net/rcmdsh.c index 7404a6d597..ab86475c84 100644 --- a/src/lib/libc/net/rcmdsh.c +++ b/src/lib/libc/net/rcmdsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.13 2014/04/24 18:56:24 jmc Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.14 2015/03/23 22:29:32 halex Exp $ */ /* * Copyright (c) 2001, MagniComp @@ -74,12 +74,9 @@ rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, /* Validate remote hostname. */ if (strcmp(*ahost, "localhost") != 0) { - if (((hp = gethostbyname2(*ahost, AF_INET)) == NULL) && - ((hp = gethostbyname2(*ahost, AF_INET6)) == NULL)) { - herror(*ahost); - return(-1); - } - *ahost = hp->h_name; + if ((hp = gethostbyname2(*ahost, AF_INET)) || + (hp = gethostbyname2(*ahost, AF_INET6))) + *ahost = hp->h_name; } /* Get a socketpair we'll use for stdin and stdout. */ -- cgit v1.2.3-55-g6feb