summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/rcmdsh.c
diff options
context:
space:
mode:
authorhalex <>2015-03-23 22:29:32 +0000
committerhalex <>2015-03-23 22:29:32 +0000
commit67fc215badd8535cee970d83424b03baed1c57f9 (patch)
treec5ca6bf2c43aa5e012c1ce770ae786cfd678c9ae /src/lib/libc/net/rcmdsh.c
parentc89070fe7b65c3f3a8a5c693ce3298a9598d1c02 (diff)
downloadopenbsd-67fc215badd8535cee970d83424b03baed1c57f9.tar.gz
openbsd-67fc215badd8535cee970d83424b03baed1c57f9.tar.bz2
openbsd-67fc215badd8535cee970d83424b03baed1c57f9.zip
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 '')
-rw-r--r--src/lib/libc/net/rcmdsh.c11
1 files changed, 4 insertions, 7 deletions
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 @@
1/* $OpenBSD: rcmdsh.c,v 1.13 2014/04/24 18:56:24 jmc Exp $ */ 1/* $OpenBSD: rcmdsh.c,v 1.14 2015/03/23 22:29:32 halex Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, MagniComp 4 * Copyright (c) 2001, MagniComp
@@ -74,12 +74,9 @@ rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser,
74 74
75 /* Validate remote hostname. */ 75 /* Validate remote hostname. */
76 if (strcmp(*ahost, "localhost") != 0) { 76 if (strcmp(*ahost, "localhost") != 0) {
77 if (((hp = gethostbyname2(*ahost, AF_INET)) == NULL) && 77 if ((hp = gethostbyname2(*ahost, AF_INET)) ||
78 ((hp = gethostbyname2(*ahost, AF_INET6)) == NULL)) { 78 (hp = gethostbyname2(*ahost, AF_INET6)))
79 herror(*ahost); 79 *ahost = hp->h_name;
80 return(-1);
81 }
82 *ahost = hp->h_name;
83 } 80 }
84 81
85 /* Get a socketpair we'll use for stdin and stdout. */ 82 /* Get a socketpair we'll use for stdin and stdout. */