summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>1999-12-11 01:59:44 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>1999-12-11 01:59:44 +0000
commit63edfa9e64654b597e649816af3401413aa5b6f4 (patch)
treee69589ca917c94de6c546c947f42ccae1726b0de
parent438b7311cc3ce74743a3916c28915e90c348f9fe (diff)
set "host" properly when getnameinfo() is successful.
-rw-r--r--libexec/telnetd/telnetd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index ae0a49b056e..9210a21480a 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: telnetd.c,v 1.19 1999/12/10 20:06:48 deraadt Exp $ */
+/* $OpenBSD: telnetd.c,v 1.20 1999/12/11 01:59:43 itojun Exp $ */
/* $NetBSD: telnetd.c,v 1.6 1996/03/20 04:25:57 tls Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: telnetd.c,v 1.5 1996/02/28 20:38:23 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: telnetd.c,v 1.19 1999/12/10 20:06:48 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: telnetd.c,v 1.20 1999/12/11 01:59:43 itojun Exp $";
#endif
#endif /* not lint */
@@ -875,7 +875,9 @@ doit(who)
(u_int)((utmp_len < 0) ? -utmp_len : utmp_len))) {
host = hp->h_name;
} else if (getnameinfo(who, who->sa_len, hbuf, sizeof(hbuf), NULL, 0,
- NI_NUMERICHOST) != 0) {
+ NI_NUMERICHOST) == 0) {
+ host = hbuf;
+ } else {
fatal(net, "getnameinfo");
}