From dcad6225a37155780e7764469b10969251848479 Mon Sep 17 00:00:00 2001 From: niklas <> Date: Fri, 4 Jun 1999 06:38:10 +0000 Subject: Be consistent about the relaxation of invalid host name checking. This allows CNAMEs to PTRs with names including slashes, something not really RFC-compliant but still in general use. --- src/lib/libc/net/gethostnamadr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/lib/libc/net/gethostnamadr.c') diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index 495ca49089..024b7f44e5 100644 --- a/src/lib/libc/net/gethostnamadr.c +++ b/src/lib/libc/net/gethostnamadr.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.34 1999/05/30 14:20:29 niklas Exp $"; +static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.35 1999/06/04 06:38:10 niklas Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -282,7 +282,11 @@ getanswer(answer, anslen, qname, qtype) } if (qtype == T_PTR && type == T_CNAME) { n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); +#ifdef USE_RESOLV_NAME_OK if ((n < 0) || !res_hnok(tbuf)) { +#else + if ((n < 0) || !_hokchar(tbuf)) { +#endif had_error++; continue; } @@ -316,7 +320,11 @@ getanswer(answer, anslen, qname, qtype) continue; /* XXX - had_error++ ? */ } n = dn_expand(answer->buf, eom, cp, bp, buflen); +#ifdef USE_RESOLV_NAME_OK if ((n < 0) || !res_hnok(bp)) { +#else + if ((n < 0) || !_hokchar(bp)) { +#endif had_error++; break; } -- cgit v1.2.3-55-g6feb