summaryrefslogtreecommitdiff
path: root/lib/libc/net/rcmdsh.c
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2015-03-23 22:29:33 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2015-03-23 22:29:33 +0000
commitddef5118e2d4748a45d360d7175fb7aea220e385 (patch)
tree75408b08e6495c8f449880da0487b4c348afac09 /lib/libc/net/rcmdsh.c
parentaed228c761d9dd414895329f7383a01c5fc7c3f2 (diff)
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@
Diffstat (limited to 'lib/libc/net/rcmdsh.c')
-rw-r--r--lib/libc/net/rcmdsh.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libc/net/rcmdsh.c b/lib/libc/net/rcmdsh.c
index 7404a6d5979..ab86475c84d 100644
--- a/lib/libc/net/rcmdsh.c
+++ b/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. */