diff options
author | niklas <> | 1999-06-04 06:38:10 +0000 |
---|---|---|
committer | niklas <> | 1999-06-04 06:38:10 +0000 |
commit | dcad6225a37155780e7764469b10969251848479 (patch) | |
tree | ad555e584d0bf0fb85386d421b09c7ce41ce820a /src/lib/libc/net/gethostnamadr.c | |
parent | 793893d418c9fc88d4515a1edecf2984bf2a99f6 (diff) | |
download | openbsd-dcad6225a37155780e7764469b10969251848479.tar.gz openbsd-dcad6225a37155780e7764469b10969251848479.tar.bz2 openbsd-dcad6225a37155780e7764469b10969251848479.zip |
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.
Diffstat (limited to 'src/lib/libc/net/gethostnamadr.c')
-rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 @@ | |||
52 | */ | 52 | */ |
53 | 53 | ||
54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) |
55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.34 1999/05/30 14:20:29 niklas Exp $"; | 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.35 1999/06/04 06:38:10 niklas Exp $"; |
56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ |
57 | 57 | ||
58 | #include <sys/param.h> | 58 | #include <sys/param.h> |
@@ -282,7 +282,11 @@ getanswer(answer, anslen, qname, qtype) | |||
282 | } | 282 | } |
283 | if (qtype == T_PTR && type == T_CNAME) { | 283 | if (qtype == T_PTR && type == T_CNAME) { |
284 | n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); | 284 | n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); |
285 | #ifdef USE_RESOLV_NAME_OK | ||
285 | if ((n < 0) || !res_hnok(tbuf)) { | 286 | if ((n < 0) || !res_hnok(tbuf)) { |
287 | #else | ||
288 | if ((n < 0) || !_hokchar(tbuf)) { | ||
289 | #endif | ||
286 | had_error++; | 290 | had_error++; |
287 | continue; | 291 | continue; |
288 | } | 292 | } |
@@ -316,7 +320,11 @@ getanswer(answer, anslen, qname, qtype) | |||
316 | continue; /* XXX - had_error++ ? */ | 320 | continue; /* XXX - had_error++ ? */ |
317 | } | 321 | } |
318 | n = dn_expand(answer->buf, eom, cp, bp, buflen); | 322 | n = dn_expand(answer->buf, eom, cp, bp, buflen); |
323 | #ifdef USE_RESOLV_NAME_OK | ||
319 | if ((n < 0) || !res_hnok(bp)) { | 324 | if ((n < 0) || !res_hnok(bp)) { |
325 | #else | ||
326 | if ((n < 0) || !_hokchar(bp)) { | ||
327 | #endif | ||
320 | had_error++; | 328 | had_error++; |
321 | break; | 329 | break; |
322 | } | 330 | } |