diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/net/rcmdsh.c | 7 |
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) |
37 | static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.8 2003/05/05 22:13:03 millert Exp $"; | 37 | static 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 | } |