diff options
Diffstat (limited to 'src/lib/libc/net/rcmdsh.c')
| -rw-r--r-- | src/lib/libc/net/rcmdsh.c | 11 |
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. */ |
