summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authormarc <>2004-04-01 04:14:29 +0000
committermarc <>2004-04-01 04:14:29 +0000
commit6bb9101e96986f7e6ffc9a472843c7d1c1ebd54b (patch)
tree0a25bbc8d4c01f5772063affeda6b92df4024b1e /src/lib
parente41f47e1fd54f7708fcf4d55a7b58281016203c1 (diff)
downloadopenbsd-6bb9101e96986f7e6ffc9a472843c7d1c1ebd54b.tar.gz
openbsd-6bb9101e96986f7e6ffc9a472843c7d1c1ebd54b.tar.bz2
openbsd-6bb9101e96986f7e6ffc9a472843c7d1c1ebd54b.zip
let rcmdsh work on hosts that don't have an ipv4 address.
If it works it is fine with me -- millert@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/rcmdsh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libc/net/rcmdsh.c b/src/lib/libc/net/rcmdsh.c
index 2a2a5d77fe..3ec97e4763 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.8 2003/05/05 22:13:03 millert Exp $ */ 1/* $OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, MagniComp 4 * Copyright (c) 2001, MagniComp
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.8 2003/05/05 22:13:03 millert Exp $"; 37static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $";
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
40#include <sys/types.h> 40#include <sys/types.h>
@@ -81,7 +81,8 @@ rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog)
81 81
82 /* Validate remote hostname. */ 82 /* Validate remote hostname. */
83 if (strcmp(*ahost, "localhost") != 0) { 83 if (strcmp(*ahost, "localhost") != 0) {
84 if ((hp = gethostbyname(*ahost)) == NULL) { 84 if (((hp = gethostbyname2(*ahost, AF_INET)) == NULL) &&
85 ((hp = gethostbyname2(*ahost, AF_INET6)) == NULL)) {
85 herror(*ahost); 86 herror(*ahost);
86 return(-1); 87 return(-1);
87 } 88 }