diff options
author | 1999-06-04 06:38:10 +0000 | |
---|---|---|
committer | 1999-06-04 06:38:10 +0000 | |
commit | 7569bc30f258fdc45d886f43b502687d20124ab2 (patch) | |
tree | 53ef2ea50285ead1c1675dca2d720f4728e78e09 | |
parent | start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@ (diff) | |
download | wireguard-openbsd-7569bc30f258fdc45d886f43b502687d20124ab2.tar.xz wireguard-openbsd-7569bc30f258fdc45d886f43b502687d20124ab2.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.
-rw-r--r-- | lib/libc/net/gethostnamadr.c | 10 | ||||
-rw-r--r-- | lib/libc/net/getnetnamadr.c | 8 |
2 files changed, 15 insertions, 3 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index 495ca490893..024b7f44e54 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/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 <sys/param.h> @@ -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; } diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c index 65a6bda9008..0ebc77b6568 100644 --- a/lib/libc/net/getnetnamadr.c +++ b/lib/libc/net/getnetnamadr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getnetnamadr.c,v 1.12 1999/05/30 14:20:29 niklas Exp $ */ +/* $OpenBSD: getnetnamadr.c,v 1.13 1999/06/04 06:38:10 niklas Exp $ */ /* * Copyright (c) 1997, Jason Downs. All rights reserved. @@ -77,7 +77,7 @@ static char sccsid[] = "@(#)getnetbyaddr.c 8.1 (Berkeley) 6/4/93"; static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03"; static char rcsid[] = "$From: getnetnamadr.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.12 1999/05/30 14:20:29 niklas Exp $"; +static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.13 1999/06/04 06:38:10 niklas Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -192,7 +192,11 @@ getnetanswer(answer, anslen, net_i) GETSHORT(n, cp); if (class == C_IN && type == T_PTR) { 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 cp += n; return (NULL); } |