diff options
author | Internet Software Consortium, Inc <@isc.org> | 2007-09-07 14:14:19 -0600 |
---|---|---|
committer | LaMont Jones <lamont@debian.org> | 2007-09-07 14:14:19 -0600 |
commit | e7ee4f9689939f41f745d8ccaae351444c6aed73 (patch) | |
tree | 21f8e9f8042f12559ba0c9b6f517bfb657469862 | |
parent | 038cb638ae3a14da41169b1d0f5cb1c992984084 (diff) | |
download | bind9-e7ee4f9689939f41f745d8ccaae351444c6aed73.tar.gz |
9.2.1rc2
43 files changed, 575 insertions, 292 deletions
@@ -1,10 +1,73 @@ + + --- 9.2.1rc2 released --- + +1240. [bug] It was possible to leak zone references by + specifying an incorrect zone to rndc. + +1239. [bug] Under certain circumstances named could continue to + use a name after it had been freed triggering + INSIST() failures. [RT #2614] + +1238. [bug] It is possible to lockup the server when shutting down + if notifies are being processed. [RT #2591] + +1237. [bug] nslookup: "set q=type" failed. + +1236. [bug] dns_rdata{class,type}_fromtext() didn't handle non + NULL terminated text regions. [RT #2588] + +1232. [bug] unix/errno2result() didn't handle EADDRNOTAVAIL. + +1231. [port] HPUX 11.11 recvmsg() can return spurious EADDRNOTAVAIL. + +1230. [bug] isccc_cc_isreply() and isccc_cc_isack() were broken. + +1229. [bug] named would crash if it received a TSIG signed + query as part of an AXFR response. [RT #2570] + +1228. [bug] 'make install' did not depend on 'make all'. [RT #2559] + +1227. [bug] dns_lex_getmastertoken() now returns ISC_R_BADNUMBER + if a number was expected and some other token was + found. [RT#2532] + +1222. [bug] Specifying 'port *' did not always result in a system + selected (non-reserved) port being used. [RT #2537] + +1221. [bug] Zone types 'master', 'slave' and 'stub' were not being + compared case insensitively. [RT #2542] + +1218. [bug] Named incorrectly returned SERVFAIL rather than + NOTAUTH when there was a TSIG BADTIME error. [RT #2519] + +1216. [bug] Multiple server clauses for the same server were not + reported. [RT #2514] + +1215. [port] solaris: add support to ifconfig.sh for x86 2.5.1 + +1214. [bug] Win32: isc_file_renameunique() could leave zero length + files behind. + +1212. [port] libbind: 64k answer buffers were causing stack space + to be exceeded for certian OS. Use heap space instead. + +1211. [bug] dns_name_fromtext() incorrectly handled certain + valid octal bitlabels. [RT #2483] + +1210. [bug] libbind: getnameinfo() failed to lookup IPv4 mapped / + compatible addresses. [RT #2461] + +1208. [bug] dns_master_load*() failed to log a error message if + an error was detected when parsing the ownername of + a record. [RT #2448] + --- 9.2.1rc1 released --- 1207. [bug] libbind: getaddrinfo() could call freeaddrinfo() with an invalid pointer. -1206. [bug] SERVFAIL and NOTIMP responses to a EDNS should trigger - a non-EDNS retry. +1206. [bug] SERVFAIL and NOTIMP responses to an EDNS query should + trigger a non-EDNS retry. 1205. [bug] OPT, TSIG and TKEY cannot be used to set the "class" of the message. [RT #2449] @@ -9,10 +9,33 @@ name. [RT #1831] [needs more work] +1025. [bug] Don't use multicast addresses to resolve iterative + queries. [RT #101] + +1034. [bug] Ignore the RD bit on multicast queries as specified + in RFC 1123. [RT #137] + +1035. [bug] If we respond to multicast queries (which we + currently do not), respond from a unicast address + as specified in RFC 1123. [RT #137] + +1037. [bug] Negative responses whose authority section contain + SOA or NS records whose owner names are not equal + equal to or parents of the query name should be + rejected. [RT #1862] + 1073. [bug] The ADB cache cleaning should also be space driven. [RT #1915, #1938] [ New function dns_adb_setadbsize() ] +1079. [bug] BIND 8 compatibility: accept bare elements at top + level of sort list treating them as if they were + a single element list. [RT #1963] + +1080. [bug] BIND 8 compatibility: accept bare IP prefixes + as the second element of a two-element top level + sort list statement. [RT #1964] + 1105. [port] OpenUNIX 8 enable threads by default. [RT #1970] [Functional change] @@ -44,25 +67,17 @@ dns_rdataset_towire(), dns_rdataset_towirepartial() and dns_rdataset_towirepartial() ] -1025. [bug] Don't use multicast addresses to resolve iterative - queries. [RT #101] - -1034. [bug] Ignore the RD bit on multicast queries as specified - in RFC 1123. [RT #137] +1192. [bug] The seconds fields in LOC records were restricted + to three decimal places. More decimal places should + be allowed but warned about. -1035. [bug] If we respond to multicast queries (which we - currently do not), respond from a unicast address - as specified in RFC 1123. [RT #137] +1209. [bug] Dig, host, nslookup were not checking the message ids + on the responses. [RT #2454] -1037. [bug] Negative responses whose authority section contain - SOA or NS records whose owner names are not equal - equal to or parents of the query name should be - rejected. [RT #1862] +1233. [bug] The flags field of a KEY record can be expressed in + hex as well as decimal. + [ Not applicable to 9.2.x ] -1079. [bug] BIND 8 compatibility: accept bare elements at top - level of sort list treating them as if they were - a single element list. [RT #1963] +1234. [bug] 'rrset-order' and 'sortlist' should be additive + not exclusive. -1080. [bug] BIND 8 compatibility: accept bare IP prefixes - as the second element of a two-element top level - sort list statement. [RT #1964] diff --git a/bin/dig/dig.c b/bin/dig/dig.c index fcd2c9d0..1a3f8804 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.c,v 1.157.2.6 2002/02/08 03:57:00 marka Exp $ */ +/* $Id: dig.c,v 1.157.2.7 2002/03/12 03:55:57 marka Exp $ */ #include <config.h> #include <stdlib.h> @@ -137,7 +137,7 @@ print_usage(FILE *fp) { } static void -usage() { +usage(void) { print_usage(stderr); fputs("\nUse \"dig -h\" (or \"dig -h | more\") " "for complete list of options\n", stderr); diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 1b5810b0..ae396767 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nslookup.c,v 1.90.2.2 2002/02/08 03:57:05 marka Exp $ */ +/* $Id: nslookup.c,v 1.90.2.3 2002/03/20 22:45:11 marka Exp $ */ #include <config.h> @@ -548,6 +548,9 @@ setoption(char *opt) { } else if (strncasecmp(opt, "qu=", 3) == 0) { if (testtype(&opt[3])) safecpy(deftype, &opt[3], sizeof(deftype)); + } else if (strncasecmp(opt, "q=", 2) == 0) { + if (testtype(&opt[2])) + safecpy(deftype, &opt[2], sizeof(deftype)); } else if (strncasecmp(opt, "domain=", 7) == 0) { safecpy(domainopt, &opt[7], sizeof(domainopt)); set_search_domain(domainopt); diff --git a/bin/named/config.c b/bin/named/config.c index b10ba494..dce52707 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.c,v 1.11.2.3 2002/02/08 03:57:09 marka Exp $ */ +/* $Id: config.c,v 1.11.2.4 2002/03/20 20:32:41 marka Exp $ */ #include <config.h> @@ -203,11 +203,11 @@ ns_config_getzonetype(cfg_obj_t *zonetypeobj) { char *str; str = cfg_obj_asstring(zonetypeobj); - if (strcmp(str, "master") == 0) + if (strcasecmp(str, "master") == 0) ztype = dns_zone_master; - else if (strcmp(str, "slave") == 0) + else if (strcasecmp(str, "slave") == 0) ztype = dns_zone_slave; - else if (strcmp(str, "stub") == 0) + else if (strcasecmp(str, "stub") == 0) ztype = dns_zone_stub; else INSIST(0); diff --git a/bin/named/query.c b/bin/named/query.c index 3408f34e..3d476e37 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.198.2.6 2002/02/08 03:57:12 marka Exp $ */ +/* $Id: query.c,v 1.198.2.7 2002/03/28 05:10:09 marka Exp $ */ #include <config.h> @@ -1815,8 +1815,7 @@ query_addcnamelike(ns_client_t *client, dns_name_t *qname, dns_name_t *tname, isc_region_t r; /* - * We assume the name data referred to by qname and tname won't - * go away. + * We assume the name data referred to by tname won't go away. */ REQUIRE(anamep != NULL); @@ -1834,7 +1833,11 @@ query_addcnamelike(ns_client_t *client, dns_name_t *qname, dns_name_t *tname, if (result != ISC_R_SUCCESS) return (result); dns_rdataset_init(rdataset); - dns_name_clone(qname, *anamep); + result = dns_name_dup(qname, client->mctx, *anamep); + if (result != ISC_R_SUCCESS) { + dns_message_puttemprdataset(client->message, &rdataset); + return (result); + } rdatalist->type = type; rdatalist->covers = 0; diff --git a/bin/named/server.c b/bin/named/server.c index 38612a42..5a4883d5 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.339.2.4 2002/02/08 03:57:13 marka Exp $ */ +/* $Id: server.c,v 1.339.2.5 2002/03/29 01:35:24 marka Exp $ */ #include <config.h> @@ -2510,10 +2510,8 @@ zone_from_args(ns_server_t *server, char *args, dns_zone_t **zonep) { /* Look for the zone name. */ zonetxt = next_token(&input, " \t"); - if (zonetxt == NULL) { - *zonep = NULL; + if (zonetxt == NULL) return (ISC_R_SUCCESS); - } /* Look for the optional class name. */ classtxt = next_token(&input, " \t"); @@ -2550,9 +2548,9 @@ zone_from_args(ns_server_t *server, char *args, dns_zone_t **zonep) { result = dns_zt_find(view->zonetable, dns_fixedname_name(&name), 0, NULL, zonep); - if (result != ISC_R_SUCCESS) - goto fail2; - fail2: + /* Partial match? */ + if (result != ISC_R_SUCCESS && *zonep != NULL) + dns_zone_detach(zonep); dns_view_detach(&view); fail1: return (result); diff --git a/bin/tests/system/ifconfig.sh b/bin/tests/system/ifconfig.sh index 6da7951b..7bbabeb3 100755 --- a/bin/tests/system/ifconfig.sh +++ b/bin/tests/system/ifconfig.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2000, 2001 Internet Software Consortium. +# Copyright (C) 2000-2002 Internet Software Consortium. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# $Id: ifconfig.sh,v 1.35.2.1 2001/11/05 04:29:35 marka Exp $ +# $Id: ifconfig.sh,v 1.35.2.3 2002/03/26 00:54:50 marka Exp $ # # Set up interface aliases for bind9 system tests. @@ -37,6 +37,9 @@ case "$1" in for ns in 1 2 3 4 5 do case "$sys" in + *-pc-solaris2.5.1) + ifconfig lo0:$ns 10.53.0.$ns netmask 0xffffffff up + ;; *-sun-solaris2.[6-7]) ifconfig lo0:$ns 10.53.0.$ns netmask 0xffffffff up ;; @@ -82,6 +85,9 @@ case "$1" in for ns in 5 4 3 2 1 do case "$sys" in + *-pc-solaris2.5.1) + ifconfig lo0:$ns 0.0.0.0 down + ;; *-sun-solaris2.[6-7]) ifconfig lo0:$ns 10.53.0.$ns down ;; diff --git a/contrib/idn/mdnkit/patch/bind9/patch.configure b/contrib/idn/mdnkit/patch/bind9/patch.configure index ee79348e..7c79cac5 100644 --- a/contrib/idn/mdnkit/patch/bind9/patch.configure +++ b/contrib/idn/mdnkit/patch/bind9/patch.configure @@ -4,7 +4,7 @@ RCS file: /proj/cvs/isc/bind9/configure,v retrieving revision 1.284.2.8 diff -u -u -2 -r1.284.2.8 configure --- configure 2001/12/05 02:30:08 1.284.2.8 -+++ configure 2002/02/12 06:30:39 ++++ configure 2002/03/26 04:43:33 @@ -370,4 +370,12 @@ ac_help="$ac_help --disable-linux-caps disable linux capabilities" diff --git a/contrib/idn/mdnkit/patch/bind9/patch.most b/contrib/idn/mdnkit/patch/bind9/patch.most index f91863ea..7ff75709 100644 --- a/contrib/idn/mdnkit/patch/bind9/patch.most +++ b/contrib/idn/mdnkit/patch/bind9/patch.most @@ -1,8 +1,6 @@ ---- README.mdnkit.orig Fri Feb 8 23:22:13 2002 -+++ README.mdnkit Tue Feb 12 17:06:01 2002 -@@ -123,2 +123,126 @@ - - ; $Id: bind-9.2.0-patch,v 1.1.2.1 2002/02/08 12:15:13 marka Exp $ +--- README.mdnkit.orig Tue Mar 26 15:20:34 2002 ++++ README.mdnkit Tue Mar 26 15:20:34 2002 +@@ -0,0 +1,124 @@ + + BIND-9 MDN patch + @@ -127,8 +125,8 @@ + + +; $Id: bind-9.2.0-patch,v 1.1.2.1 2002/02/08 12:15:13 marka Exp $ ---- config.h.in.orig Tue Feb 12 11:41:27 2002 -+++ config.h.in Tue Feb 12 17:06:01 2002 +--- config.h.in.orig Tue Feb 12 20:18:50 2002 ++++ config.h.in Tue Mar 26 15:18:22 2002 @@ -142,4 +142,7 @@ #undef HAVE_STRERROR @@ -152,8 +150,8 @@ +/* define if mDNkit support is to be included. */ +#undef WITH_MDN + ---- configure.in.orig Tue Feb 12 11:42:15 2002 -+++ configure.in Tue Feb 12 17:06:01 2002 +--- configure.in.orig Tue Feb 12 20:20:00 2002 ++++ configure.in Tue Mar 26 15:18:23 2002 @@ -1615,4 +1615,77 @@ # @@ -232,8 +230,8 @@ +# # Substitutions # ---- bin/dig/dig.1.orig Tue Feb 12 11:42:17 2002 -+++ bin/dig/dig.1 Tue Feb 12 17:06:01 2002 +--- bin/dig/dig.1.orig Tue Feb 12 17:42:49 2002 ++++ bin/dig/dig.1 Tue Mar 26 15:18:23 2002 @@ -74,5 +74,5 @@ .TP \fBtype\fR @@ -257,8 +255,8 @@ +\fBdig\fR runs. .SH "FILES" .PP ---- bin/dig/dig.c.orig Tue Feb 12 11:42:22 2002 -+++ bin/dig/dig.c Tue Feb 12 17:06:01 2002 +--- bin/dig/dig.c.orig Tue Mar 12 14:55:57 2002 ++++ bin/dig/dig.c Tue Mar 26 15:18:23 2002 @@ -1308,4 +1308,9 @@ ISC_LIST_APPEND(lookup_list, lookup, link); } @@ -269,8 +267,8 @@ +#endif } ---- bin/dig/dig.docbook.orig Tue Feb 12 11:42:24 2002 -+++ bin/dig/dig.docbook Tue Feb 12 17:06:02 2002 +--- bin/dig/dig.docbook.orig Tue Feb 12 17:42:57 2002 ++++ bin/dig/dig.docbook Tue Mar 26 15:18:23 2002 @@ -524,4 +524,19 @@ <refsect1> @@ -291,8 +289,8 @@ +<refsect1> <title>FILES</title> <para> ---- bin/dig/dighost.c.orig Tue Feb 12 11:42:34 2002 -+++ bin/dig/dighost.c Tue Feb 12 17:06:02 2002 +--- bin/dig/dighost.c.orig Wed Feb 20 10:02:43 2002 ++++ bin/dig/dighost.c Tue Mar 26 15:18:23 2002 @@ -33,4 +33,15 @@ #include <limits.h> @@ -447,7 +445,7 @@ +#endif else { len = strlen(lookup->textname); -@@ -2590,2 +2693,115 @@ +@@ -2592,2 +2695,115 @@ isc_mem_destroy(&mctx); } + @@ -563,8 +561,8 @@ +} + +#endif /* WITH_MDN */ ---- bin/dig/host.1.orig Tue Feb 12 11:42:35 2002 -+++ bin/dig/host.1 Tue Feb 12 17:06:02 2002 +--- bin/dig/host.1.orig Tue Feb 12 17:43:07 2002 ++++ bin/dig/host.1 Tue Mar 26 15:18:23 2002 @@ -88,6 +88,6 @@ .PP Non-recursive queries can be made via the \fB-r\fR option. @@ -590,8 +588,8 @@ +\fBhost\fR runs. .SH "FILES" .PP ---- bin/dig/host.c.orig Tue Feb 12 11:42:37 2002 -+++ bin/dig/host.c Tue Feb 12 17:06:02 2002 +--- bin/dig/host.c.orig Tue Feb 12 17:43:09 2002 ++++ bin/dig/host.c Tue Mar 26 15:18:23 2002 @@ -667,4 +667,9 @@ ISC_LIST_APPEND(lookup_list, lookup, link); @@ -602,8 +600,8 @@ + usesearch = ISC_TRUE; } ---- bin/dig/host.docbook.orig Tue Feb 12 11:42:38 2002 -+++ bin/dig/host.docbook Tue Feb 12 17:06:02 2002 +--- bin/dig/host.docbook.orig Tue Feb 12 17:43:10 2002 ++++ bin/dig/host.docbook Tue Mar 26 15:18:24 2002 @@ -182,4 +182,19 @@ <refsect1> @@ -624,9 +622,9 @@ +<refsect1> <title>FILES</title> <para> ---- bin/dig/nslookup.c.orig Tue Feb 12 11:42:41 2002 -+++ bin/dig/nslookup.c Tue Feb 12 17:06:02 2002 -@@ -657,4 +657,8 @@ +--- bin/dig/nslookup.c.orig Thu Mar 21 09:45:11 2002 ++++ bin/dig/nslookup.c Tue Mar 26 15:18:24 2002 +@@ -660,4 +660,8 @@ lookup->origin = NULL; ISC_LIST_INIT(lookup->my_server_list); +#ifdef WITH_MDN @@ -635,8 +633,8 @@ +#endif debug("looking up %s", lookup->textname); } ---- bin/dig/include/dig/dig.h.orig Thu Nov 15 12:24:13 2001 -+++ bin/dig/include/dig/dig.h Tue Feb 12 17:06:03 2002 +--- bin/dig/include/dig/dig.h.orig Tue Feb 12 17:43:14 2002 ++++ bin/dig/include/dig/dig.h Tue Mar 26 15:18:24 2002 @@ -75,4 +75,11 @@ */ @@ -657,8 +655,8 @@ +#endif dnssec; char textname[MXNAME]; /* Name we're going to be looking up */ ---- lib/dns/name.c.orig Tue Feb 12 11:43:36 2002 -+++ lib/dns/name.c Tue Feb 12 17:06:03 2002 +--- lib/dns/name.c.orig Tue Mar 26 14:57:49 2002 ++++ lib/dns/name.c Tue Mar 26 15:18:24 2002 @@ -195,4 +195,11 @@ dns_name_t *dns_wildcardname = &wild; @@ -697,8 +695,8 @@ + totext_filter_proc = proc; +} +#endif ---- lib/dns/include/dns/name.h.orig Tue Feb 12 11:43:41 2002 -+++ lib/dns/include/dns/name.h Tue Feb 12 17:06:03 2002 +--- lib/dns/include/dns/name.h.orig Tue Feb 12 20:23:10 2002 ++++ lib/dns/include/dns/name.h Tue Mar 26 15:18:24 2002 @@ -219,4 +219,15 @@ #define DNS_NAME_MAXWIRE 255 diff --git a/lib/bind/irs/dns_ho.c b/lib/bind/irs/dns_ho.c index a563ff74..531b79f2 100644 --- a/lib/bind/irs/dns_ho.c +++ b/lib/bind/irs/dns_ho.c @@ -52,7 +52,7 @@ /* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: dns_ho.c,v 1.5.2.1 2001/11/02 20:35:28 gson Exp $"; +static const char rcsid[] = "$Id: dns_ho.c,v 1.5.2.2 2002/03/20 19:44:39 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /* Imports. */ @@ -256,47 +256,55 @@ ho_byname2(struct irs_ho *this, const char *name, int af) char tmp[NS_MAXDNAME]; const char *cp; struct addrinfo ai; - struct dns_res_target q, q2, *p; + struct dns_res_target *q, *q2, *p; int querystate = RESQRY_FAIL; if (init(this) == -1) return (NULL); - memset(&q, 0, sizeof(q2)); - memset(&q2, 0, sizeof(q2)); + q = memget(sizeof(*q)); + q2 = memget(sizeof(*q2)); + if (q == NULL || q2 == NULL) { + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); + errno = ENOMEM; + goto cleanup; + } + memset(q, 0, sizeof(q)); + memset(q2, 0, sizeof(q2)); switch (af) { case AF_INET: size = INADDRSZ; - q.qclass = C_IN; - q.qtype = T_A; - q.answer = q.qbuf.buf; - q.anslen = sizeof(q.qbuf); - q.action = RESTGT_DOALWAYS; + q->qclass = C_IN; + q->qtype = T_A; + q->answer = q->qbuf.buf; + q->anslen = sizeof(q->qbuf); + q->action = RESTGT_DOALWAYS; break; case AF_INET6: size = IN6ADDRSZ; - q.qclass = C_IN; - q.qtype = ns_t_a6; - q.answer = q.qbuf.buf; - q.anslen = sizeof(q.qbuf); - q.next = &q2; + q->qclass = C_IN; + q->qtype = ns_t_a6; + q->answer = q->qbuf.buf; + q->anslen = sizeof(q->qbuf); + q->next = q2; #ifdef RES_USE_A6 if ((pvt->res->options & RES_USE_A6) == 0) - q.action = RESTGT_IGNORE; + q->action = RESTGT_IGNORE; else #endif - q.action = RESTGT_DOALWAYS; - q2.qclass = C_IN; - q2.qtype = T_AAAA; - q2.answer = q2.qbuf.buf; - q2.anslen = sizeof(q2.qbuf); - q2.action = RESTGT_AFTERFAILURE; + q->action = RESTGT_DOALWAYS; + q2->qclass = C_IN; + q2->qtype = T_AAAA; + q2->answer = q2->qbuf.buf; + q2->anslen = sizeof(q2->qbuf); + q2->action = RESTGT_AFTERFAILURE; break; default: RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); errno = EAFNOSUPPORT; - return (NULL); + hp = NULL; + goto cleanup; } /* @@ -308,7 +316,7 @@ ho_byname2(struct irs_ho *this, const char *name, int af) tmp, sizeof tmp))) name = cp; - for (p = &q; p; p = p->next) { + for (p = q; p; p = p->next) { switch(p->action) { case RESTGT_DOALWAYS: break; @@ -331,13 +339,18 @@ ho_byname2(struct irs_ho *this, const char *name, int af) if ((hp = gethostans(this, p->answer, n, name, p->qtype, af, size, NULL, (const struct addrinfo *)&ai)) != NULL) - return(hp); /* no more loop is necessary */ + goto cleanup; /* no more loop is necessary */ querystate = RESQRY_FAIL; continue; } - return(hp); /* should be NULL */ + cleanup: + if (q != NULL) + memput(q, sizeof(*q)); + if (q2 != NULL) + memput(q2, sizeof(*q2)); + return(hp); } static struct hostent * @@ -346,17 +359,24 @@ ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) struct pvt *pvt = (struct pvt *)this->private; const u_char *uaddr = addr; char *qp; - struct hostent *hp; + struct hostent *hp = NULL; struct addrinfo ai; - struct dns_res_target q, q2, *p; + struct dns_res_target *q, *q2, *p; int n, size; int querystate = RESQRY_FAIL; if (init(this) == -1) return (NULL); - memset(&q, 0, sizeof(q2)); - memset(&q2, 0, sizeof(q2)); + q = memget(sizeof(*q)); + q2 = memget(sizeof(*q2)); + if (q == NULL || q2 == NULL) { + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); + errno = ENOMEM; + goto cleanup; + } + memset(q, 0, sizeof(q)); + memset(q2, 0, sizeof(q2)); if (af == AF_INET6 && len == IN6ADDRSZ && (!memcmp(uaddr, mapped, sizeof mapped) || @@ -371,45 +391,47 @@ ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) switch (af) { case AF_INET: size = INADDRSZ; - q.qclass = C_IN; - q.qtype = T_PTR; - q.answer = q.qbuf.buf; - q.anslen = sizeof(q.qbuf); - q.action = RESTGT_DOALWAYS; + q->qclass = C_IN; + q->qtype = T_PTR; + q->answer = q->qbuf.buf; + q->anslen = sizeof(q->qbuf); + q->action = RESTGT_DOALWAYS; break; case AF_INET6: size = IN6ADDRSZ; - q.qclass = C_IN; - q.qtype = T_PTR; - q.answer = q.qbuf.buf; - q.anslen = sizeof(q.qbuf); - q.next = &q2; + q->qclass = C_IN; + q->qtype = T_PTR; + q->answer = q->qbuf.buf; + q->anslen = sizeof(q->qbuf); + q->next = q2; if ((pvt->res->options & RES_NO_BITSTRING) != 0) - q.action = RESTGT_IGNORE; + q->action = RESTGT_IGNORE; else - q.action = RESTGT_DOALWAYS; - q2.qclass = C_IN; - q2.qtype = T_PTR; - q2.answer = q2.qbuf.buf; - q2.anslen = sizeof(q2.qbuf); + q->action = RESTGT_DOALWAYS; + q2->qclass = C_IN; + q2->qtype = T_PTR; + q2->answer = q2->qbuf.buf; + q2->anslen = sizeof(q2->qbuf); if ((pvt->res->options & RES_NO_NIBBLE) != 0) - q2.action = RESTGT_IGNORE; + q2->action = RESTGT_IGNORE; else - q2.action = RESTGT_AFTERFAILURE; + q2->action = RESTGT_AFTERFAILURE; break; default: errno = EAFNOSUPPORT; RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); - return (NULL); + hp = NULL; + goto cleanup; } if (size > len) { errno = EINVAL; RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); - return (NULL); + hp = NULL; + goto cleanup; } switch (af) { case AF_INET: - qp = q.qname; + qp = q->qname; (void) sprintf(qp, "%u.%u.%u.%u.in-addr.arpa", (uaddr[3] & 0xff), (uaddr[2] & 0xff), @@ -417,16 +439,16 @@ ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) (uaddr[0] & 0xff)); break; case AF_INET6: - if (q.action != RESTGT_IGNORE) { - qp = q.qname; + if (q->action != RESTGT_IGNORE) { + qp = q->qname; qp += SPRINTF((qp, "\\[x")); for (n = 0; n < IN6ADDRSZ; n++) qp += SPRINTF((qp, "%02x", uaddr[n])); SPRINTF((qp, "/128].%s", res_get_bitstringsuffix(pvt->res))); } - if (q2.action != RESTGT_IGNORE) { - qp = q2.qname; + if (q2->action != RESTGT_IGNORE) { + qp = q2->qname; for (n = IN6ADDRSZ - 1; n >= 0; n--) { qp += SPRINTF((qp, "%x.%x.", uaddr[n] & 0xf, @@ -439,7 +461,7 @@ ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) abort(); } - for (p = &q; p; p = p->next) { + for (p = q; p; p = p->next) { switch(p->action) { case RESTGT_DOALWAYS: break; @@ -477,10 +499,16 @@ ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) } RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS); - return (hp); /* no more loop is necessary. */ + goto cleanup; /* no more loop is necessary. */ } - - return(NULL); /* H_ERRNO was set by subroutines */ + hp = NULL; /* H_ERRNO was set by subroutines */ + + cleanup: + if (q != NULL) + memput(q, sizeof(*q)); + if (q2 != NULL) + memput(q2, sizeof(*q2)); + return(hp); } static struct hostent * @@ -536,74 +564,83 @@ ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai) int n; char tmp[NS_MAXDNAME]; const char *cp; - struct dns_res_target q, q2, q3, *p; + struct dns_res_target *q, *q2, *q3, *p; struct addrinfo sentinel, *cur; int querystate = RESQRY_FAIL; if (init(this) == -1) return (NULL); - memset(&q, 0, sizeof(q2)); - memset(&q2, 0, sizeof(q2)); - memset(&q3, 0, sizeof(q3)); memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + q = memget(sizeof(*q)); + q2 = memget(sizeof(*q2)); + q3 = memget(sizeof(*q3)); + if (q == NULL || q2 == NULL || q3 == NULL) { + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); + errno = ENOMEM; + goto cleanup; + } + memset(q, 0, sizeof(q2)); + memset(q2, 0, sizeof(q2)); + memset(q3, 0, sizeof(q3)); + switch (pai->ai_family) { case AF_UNSPEC: /* prefer IPv6 */ - q.qclass = C_IN; - q.qtype = ns_t_a6; - q.answer = q.qbuf.buf; - q.anslen = sizeof(q.qbuf); - q.next = &q2; + q->qclass = C_IN; + q->qtype = ns_t_a6; + q->answer = q->qbuf.buf; + q->anslen = sizeof(q->qbuf); + q->next = q2; #ifdef RES_USE_A6 if ((pvt->res->options & RES_USE_A6) == 0) - q.action = RESTGT_IGNORE; + q->action = RESTGT_IGNORE; else #endif - q.action = RESTGT_DOALWAYS; - q2.qclass = C_IN; - q2.qtype = T_AAAA; - q2.answer = q2.qbuf.buf; - q2.anslen = sizeof(q2.qbuf); - q2.next = &q3; + q->action = RESTGT_DOALWAYS; + q2->qclass = C_IN; + q2->qtype = T_AAAA; + q2->answer = q2->qbuf.buf; + q2->anslen = sizeof(q2->qbuf); + q2->next = q3; /* try AAAA only when A6 query fails */ - q2.action = RESTGT_AFTERFAILURE; - q3.qclass = C_IN; - q3.qtype = T_A; - q3.answer = q3.qbuf.buf; - q3.anslen = sizeof(q3.qbuf); - q3.action = RESTGT_DOALWAYS; + q2->action = RESTGT_AFTERFAILURE; + q3->qclass = C_IN; + q3->qtype = T_A; + q3->answer = q3->qbuf.buf; + q3->anslen = sizeof(q3->qbuf); + q3->action = RESTGT_DOALWAYS; break; case AF_INET: - q.qclass = C_IN; - q.qtype = T_A; - q.answer = q.qbuf.buf; - q.anslen = sizeof(q.qbuf); - q.action = RESTGT_DOALWAYS; + q->qclass = C_IN; + q->qtype = T_A; + q->answer = q->qbuf.buf; + q->anslen = sizeof(q->qbuf); + q->action = RESTGT_DOALWAYS; break; case AF_INET6: - q.qclass = C_IN; - q.qtype = ns_t_a6; - q.answer = q.qbuf.buf; - q.anslen = sizeof(q.qbuf); - q.next = &q2; + q->qclass = C_IN; + q->qtype = ns_t_a6; + q->answer = q->qbuf.buf; + q->anslen = sizeof(q->qbuf); + q->next = q2; #ifdef RES_USE_A6 if ((pvt->res->options & RES_USE_A6) == 0) - q.action = RESTGT_IGNORE; + q->action = RESTGT_IGNORE; else #endif - q.action = RESTGT_DOALWAYS; - q2.qclass = C_IN; - q2.qtype = T_AAAA; - q2.answer = q2.qbuf.buf; - q2.anslen = sizeof(q2.qbuf); - q2.action = RESTGT_AFTERFAILURE; + q->action = RESTGT_DOALWAYS; + q2->qclass = C_IN; + q2->qtype = T_AAAA; + q2->answer = q2->qbuf.buf; + q2->anslen = sizeof(q2->qbuf); + q2->action = RESTGT_AFTERFAILURE; break; default: RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); /* better error? */ - return(NULL); + goto cleanup; } /* @@ -615,7 +652,7 @@ ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai) tmp, sizeof tmp))) name = cp; - for (p = &q; p; p = p->next) { + for (p = q; p; p = p->next) { struct addrinfo *ai; switch(p->action) { @@ -647,6 +684,13 @@ ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai) querystate = RESQRY_FAIL; } + cleanup: + if (q != NULL) + memput(q, sizeof(*q)); + if (q2 != NULL) + memput(q2, sizeof(*q2)); + if (q3 != NULL) + memput(q3, sizeof(*q3)); return(sentinel.ai_next); } diff --git a/lib/bind/irs/dns_nw.c b/lib/bind/irs/dns_nw.c index 43a404ed..bbde4edd 100644 --- a/lib/bind/irs/dns_nw.c +++ b/lib/bind/irs/dns_nw.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: dns_nw.c,v 1.3.2.1 2002/01/22 04:15:44 marka Exp $"; +static const char rcsid[] = "$Id: dns_nw.c,v 1.3.2.2 2002/03/20 19:44:40 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /* Imports. */ @@ -240,22 +240,33 @@ nw_res_set(struct irs_nw *this, struct __res_state *res, static struct nwent * get1101byname(struct irs_nw *this, const char *name) { struct pvt *pvt = (struct pvt *)this->private; - u_char ansbuf[MAXPACKET]; + u_char *ansbuf; int anslen; + struct nwent *result; - anslen = res_nsearch(pvt->res, name, C_IN, T_PTR, - ansbuf, sizeof ansbuf); - if (anslen < 0) + ansbuf = memget(MAXPACKET); + if (ansbuf == NULL) { + errno = ENOMEM; + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); return (NULL); - return (get1101mask(this, get1101answer(this, ansbuf, anslen, by_name, - AF_INET, name, NULL, 0))); + } + anslen = res_nsearch(pvt->res, name, C_IN, T_PTR, ansbuf, MAXPACKET); + if (anslen < 0) { + memput(ansbuf, MAXPACKET); + return (NULL); + } + result = get1101mask(this, get1101answer(this, ansbuf, anslen, by_name, + AF_INET, name, NULL, 0)); + memput(ansbuf, MAXPACKET); + return (result); } static struct nwent * get1101byaddr(struct irs_nw *this, u_char *net, int len) { struct pvt *pvt = (struct pvt *)this->private; char qbuf[sizeof "255.255.255.255.in-addr.arpa"]; - u_char ansbuf[MAXPACKET]; + struct nwent *result; + u_char *ansbuf; int anslen; if (len < 1 || len > 32) { @@ -265,12 +276,21 @@ get1101byaddr(struct irs_nw *this, u_char *net, int len) { } if (make1101inaddr(net, len, qbuf, sizeof qbuf) < 0) return (NULL); - anslen = res_nquery(pvt->res, qbuf, C_IN, T_PTR, - ansbuf, sizeof ansbuf); - if (anslen < 0) + ansbuf = memget(MAXPACKET); + if (ansbuf == NULL) { + errno = ENOMEM; + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); + return (NULL); + } + anslen = res_nquery(pvt->res, qbuf, C_IN, T_PTR, ansbuf, MAXPACKET); + if (anslen < 0) { + memput(ansbuf, MAXPACKET); return (NULL); - return (get1101mask(this, get1101answer(this, ansbuf, anslen, by_addr, - AF_INET, NULL, net, len))); + } + result = get1101mask(this, get1101answer(this, ansbuf, anslen, by_addr, + AF_INET, NULL, net, len)); + memput(ansbuf, MAXPACKET); + return (result); } static struct nwent * @@ -430,7 +450,7 @@ get1101mask(struct irs_nw *this, struct nwent *nwent) { struct pvt *pvt = (struct pvt *)this->private; char qbuf[sizeof "255.255.255.255.in-addr.arpa"], owner[MAXDNAME]; int anslen, type, class, ancount, qdcount; - u_char ansbuf[MAXPACKET], *cp, *eom; + u_char *ansbuf, *cp, *eom; HEADER *hp; if (!nwent) @@ -441,10 +461,18 @@ get1101mask(struct irs_nw *this, struct nwent *nwent) { return (nwent); } + ansbuf = memget(MAXPACKET); + if (ansbuf == NULL) { + errno = ENOMEM; + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); + return (NULL); + } /* Query for the A RR that would hold this network's mask. */ - anslen = res_nquery(pvt->res, qbuf, C_IN, T_A, ansbuf, sizeof ansbuf); - if (anslen < HFIXEDSZ) + anslen = res_nquery(pvt->res, qbuf, C_IN, T_A, ansbuf, MAXPACKET); + if (anslen < HFIXEDSZ) { + memput(ansbuf, MAXPACKET); return (nwent); + } /* Initialize, and parse header. */ hp = (HEADER *)ansbuf; @@ -454,8 +482,10 @@ get1101mask(struct irs_nw *this, struct nwent *nwent) { while (qdcount-- > 0) { int n = dn_skipname(cp, eom); cp += n + QFIXEDSZ; - if (n < 0 || cp > eom) + if (n < 0 || cp > eom) { + memput(ansbuf, MAXPACKET); return (nwent); + } } ancount = ntohs(hp->ancount); @@ -489,6 +519,7 @@ get1101mask(struct irs_nw *this, struct nwent *nwent) { } cp += n; /* RDATA */ } + memput(ansbuf, MAXPACKET); return (nwent); } diff --git a/lib/bind/irs/getnameinfo.c b/lib/bind/irs/getnameinfo.c index 0e86cc15..9b26c641 100644 --- a/lib/bind/irs/getnameinfo.c +++ b/lib/bind/irs/getnameinfo.c @@ -105,9 +105,9 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) int family, i; const char *addr; char *p; - u_char pfx; char numserv[512]; char numaddr[512]; + const struct sockaddr_in6 *sin6; if (sa == NULL) return EAI_FAIL; @@ -157,9 +157,23 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) flags |= NI_NUMERICHOST; break; case AF_INET6: - pfx = *addr; - if (pfx == 0 || pfx == 0xfe || pfx == 0xff) - flags |= NI_NUMERICHOST; + sin6 = (const struct sockaddr_in6 *)sa; + switch (sin6->sin6_addr.s6_addr[0]) { + case 0x00: + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + ; + else if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) + ; + else + flags |= NI_NUMERICHOST; + break; + default: + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + flags |= NI_NUMERICHOST; + else if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) + flags |= NI_NUMERICHOST; + break; + } break; } if (host == NULL || hostlen == 0) { diff --git a/lib/bind/port_after.h.in b/lib/bind/port_after.h.in index f120779e..fcbc99c9 100644 --- a/lib/bind/port_after.h.in +++ b/lib/bind/port_after.h.in @@ -156,11 +156,32 @@ extern const struct in6_addr in6addr_any; IN6_ARE_ADDR_EQUAL(a, &in6addr_any) #endif +#ifndef IN6_IS_ADDR_LOOPBACK +extern const struct in6_addr isc_in6addr_loopback; +#define IN6_IS_ADDR_LOOPBACK(a) \ + IN6_ARE_ADDR_EQUAL(a, &isc_in6addr_loopback) +#endif + +#ifndef IN6_IS_ADDR_V4MAPPED +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((a)->s6_addr[0] == 0x00 && (a)->s6_addr[1] == 0x00 && \ + (a)->s6_addr[2] == 0x00 && (a)->s6_addr[3] == 0x00 && \ + (a)->s6_addr[4] == 0x00 && (a)->s6_addr[5] == 0x00 && \ + (a)->s6_addr[6] == 0x00 && (a)->s6_addr[9] == 0x00 && \ + (a)->s6_addr[8] == 0x00 && (a)->s6_addr[9] == 0x00 && \ + (a)->s6_addr[10] == 0xff && (a)->s6_addr[11] == 0xff) +#endif + #ifndef IN6_IS_ADDR_SITELOCAL #define IN6_IS_ADDR_SITELOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) #endif +#ifndef IN6_IS_ADDR_LINKLOCAL +#define IN6_IS_ADDR_LINKLOCAL(a) \ + (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) +#endif + #ifndef IN6_IS_ADDR_MULTICAST #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) #endif diff --git a/lib/dns/api b/lib/dns/api index c1c50369..b68bc303 100644 --- a/lib/dns/api +++ b/lib/dns/api @@ -1,3 +1,3 @@ -LIBINTERFACE = 6 -LIBREVISION = 0 -LIBAGE = 1 +LIBINTERFACE = 7 +LIBREVISION = 1 +LIBAGE = 2 diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index 54db08e4..3796487c 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001 Internet Software Consortium. + * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.c,v 1.101 2001/08/08 22:54:38 gson Exp $ */ +/* $Id: dispatch.c,v 1.101.2.2 2002/03/26 00:54:52 marka Exp $ */ #include <config.h> @@ -1212,16 +1212,11 @@ dns_dispatchmgr_destroy(dns_dispatchmgr_t **mgrp) { static isc_boolean_t local_addr_match(dns_dispatch_t *disp, isc_sockaddr_t *addr) { - in_port_t port; if (addr == NULL) return (ISC_TRUE); - port = isc_sockaddr_getport(addr); - if (port == 0) - return (isc_sockaddr_eqaddr(&disp->local, addr)); - else - return (isc_sockaddr_equal(&disp->local, addr)); + return (isc_sockaddr_equal(&disp->local, addr)); } /* diff --git a/lib/dns/gen.c b/lib/dns/gen.c index c24254d9..3373ac3c 100644 --- a/lib/dns/gen.c +++ b/lib/dns/gen.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: gen.c,v 1.65 2001/08/08 22:54:39 gson Exp $ */ +/* $Id: gen.c,v 1.65.2.2 2002/03/26 00:54:54 marka Exp $ */ #include <config.h> @@ -666,9 +666,11 @@ main(int argc, char **argv) { * Here, walk the list from top to bottom, calculating * the hash (mod 256) for each name. */ - fprintf(stdout, "#define RDATATYPE_COMPARE(_s, _d, _tn, _tp) \\\n"); + fprintf(stdout, "#define RDATATYPE_COMPARE(_s, _d, _tn, _n, _tp) \\\n"); fprintf(stdout, "\tdo { \\\n"); - fprintf(stdout, "\t\tif (strcasecmp(_s,(_tn)) == 0) { \\\n"); + fprintf(stdout, "\t\tif (sizeof(_s) - 1 == _n && \\\n" + "\t\t strncasecmp(_s,(_tn)," + "(sizeof(_s) - 1)) == 0) { \\\n"); fprintf(stdout, "\t\t\tif ((typeattr[_d].flags & " "DNS_RDATATYPEATTR_RESERVED) != 0) \\\n"); fprintf(stdout, "\t\t\t\treturn (ISC_R_NOTIMPLEMENTED); \\\n"); @@ -677,8 +679,8 @@ main(int argc, char **argv) { fprintf(stdout, "\t\t} \\\n"); fprintf(stdout, "\t} while (0)\n\n"); - fprintf(stdout, "#define RDATATYPE_FROMTEXT_SW(_hash,_typename,_typep) " - "\\\n"); + fprintf(stdout, "#define RDATATYPE_FROMTEXT_SW(_hash," + "_typename,_length,_typep) \\\n"); fprintf(stdout, "\tswitch (_hash) { \\\n"); for (i = 0 ; i <= 255 ; i++) { ttn = &typenames[i]; @@ -703,7 +705,7 @@ main(int argc, char **argv) { if (hash == HASH(ttn2->typename)) { fprintf(stdout, "\t\t\tRDATATYPE_COMPARE" "(\"%s\", %u, " - "_typename, _typep); \\\n", + "_typename, _length, _typep); \\\n", ttn2->typename, j); ttn2->sorted = 1; } diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index 44c7e088..768033cb 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.81.2.1 2001/09/19 21:51:42 bwelling Exp $ */ +/* $Id: result.h,v 1.81.2.3 2002/03/26 00:55:02 marka Exp $ */ #ifndef DNS_RESULT_H #define DNS_RESULT_H 1 @@ -116,8 +116,13 @@ #define DNS_R_BADIXFR (ISC_RESULTCLASS_DNS + 77) /* #define DNS_R_unused (ISC_RESULTCLASS_DNS + 78) */ #define DNS_R_NOVALIDKEY (ISC_RESULTCLASS_DNS + 79) +#define DNS_R_OBSOLETE (ISC_RESULTCLASS_DNS + 80) +#define DNS_R_FROZEN (ISC_RESULTCLASS_DNS + 81) +#define DNS_R_UNKNOWNFLAG (ISC_RESULTCLASS_DNS + 82) +#define DNS_R_EXPECTEDRESPONSE (ISC_RESULTCLASS_DNS + 83) -#define DNS_R_NRESULTS 80 /* Number of results */ + +#define DNS_R_NRESULTS 84 /* Number of results */ /* * DNS wire format rcodes. diff --git a/lib/dns/include/dns/tsig.h b/lib/dns/include/dns/tsig.h index 8a8d7668..1debf9c9 100644 --- a/lib/dns/include/dns/tsig.h +++ b/lib/dns/include/dns/tsig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001 Internet Software Consortium. + * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tsig.h,v 1.40 2001/07/16 05:10:28 mayer Exp $ */ +/* $Id: tsig.h,v 1.40.2.2 2002/03/26 00:55:04 marka Exp $ */ #ifndef DNS_TSIG_H #define DNS_TSIG_H 1 @@ -188,6 +188,9 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg, * DNS_R_CLOCKSKEW - the TSIG failed to verify because of * the time was out of the allowed range. * DNS_R_TSIGVERIFYFAILURE - the TSIG failed to verify + * DNS_R_EXPECTEDRESPONSE - the message was set over TCP and + * should have been a response, + * but was not. */ isc_result_t diff --git a/lib/dns/master.c b/lib/dns/master.c index ed790216..f8a2b90d 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: master.c,v 1.122.2.4 2002/02/08 03:57:27 marka Exp $ */ +/* $Id: master.c,v 1.122.2.5 2002/03/20 19:15:13 marka Exp $ */ #include <config.h> @@ -1110,10 +1110,11 @@ load(dns_loadctx_t *lctx) { ictx->origin, ISC_FALSE, NULL); if (MANYERRS(lctx, result)) { SETRESULT(lctx, result); + LOGITFILE(result, include_file); read_till_eol = ISC_TRUE; continue; } else if (result != ISC_R_SUCCESS) - goto insist_and_cleanup; + goto log_and_cleanup; /* * Finish $ORIGIN / $INCLUDE processing if required. diff --git a/lib/dns/name.c b/lib/dns/name.c index 0ed0a04f..ed6581ff 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.127 2001/06/28 21:34:11 gson Exp $ */ +/* $Id: name.c,v 1.127.2.2 2002/03/26 00:54:55 marka Exp $ */ #include <config.h> @@ -1484,8 +1484,8 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, * addition of another byte * below. */ - n1 = bitlength - 1 / 8; - n2 = tbcount - 1 / 8; + n1 = (bitlength - 1) / 8; + n2 = (tbcount - 1) / 8; if (n1 != n2) { if (value != 0) return diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 4760958e..9fc7b675 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdata.c,v 1.147.2.5 2002/02/20 02:17:24 marka Exp $ */ +/* $Id: rdata.c,v 1.147.2.7 2002/03/27 23:52:33 marka Exp $ */ #include <config.h> #include <ctype.h> @@ -1028,7 +1028,7 @@ isc_result_t dns_rdataclass_fromtext(dns_rdataclass_t *classp, isc_textregion_t *source) { #define COMPARE(string, rdclass) \ if (((sizeof(string) - 1) == source->length) \ - && (strcasecmp(source->base, string) == 0)) { \ + && (strncasecmp(source->base, string, source->length) == 0)) { \ *classp = rdclass; \ return (ISC_R_SUCCESS); \ } @@ -1045,12 +1045,18 @@ dns_rdataclass_fromtext(dns_rdataclass_t *classp, isc_textregion_t *source) { */ COMPARE("ch", dns_rdataclass_chaos); COMPARE("chaos", dns_rdataclass_chaos); + if (source->length > 5 && - strncasecmp("class", source->base, 5) == 0) - { + source->length < (5 + sizeof("65000")) && + strncasecmp("class", source->base, 5) == 0) { + char buf[sizeof("65000")]; char *endp; - int val = strtol(source->base + 5, &endp, 10); - if (*endp == '\0' && val >= 0 && val <= 0xffff) { + unsigned int val; + + strncpy(buf, source->base + 5, source->length - 5); + buf[source->length - 5] = '\0'; + val = strtoul(buf, &endp, 10); + if (*endp == '\0' && val <= 0xffff) { *classp = (dns_rdataclass_t)val; return (ISC_R_SUCCESS); } @@ -1144,12 +1150,18 @@ dns_rdatatype_fromtext(dns_rdatatype_t *typep, isc_textregion_t *source) { * to return a result to the caller if it is a valid (known) * rdatatype name. */ - RDATATYPE_FROMTEXT_SW(hash, source->base, typep); + RDATATYPE_FROMTEXT_SW(hash, source->base, n, typep); - if (source->length > 4 && strncasecmp("type", source->base, 4) == 0) { + if (source->length > 4 && source->length < (4 + sizeof("65000")) && + strncasecmp("type", source->base, 4) == 0) { + char buf[sizeof("65000")]; char *endp; - int val = strtol(source->base + 4, &endp, 10); - if (*endp == '\0' && val >= 0 && val <= 0xffff) { + unsigned int val; + + strncpy(buf, source->base + 4, source->length - 4); + buf[source->length - 4] = '\0'; + val = strtoul(buf, &endp, 10); + if (*endp == '\0' && val <= 0xffff) { *typep = (dns_rdatatype_t)val; return (ISC_R_SUCCESS); } diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 50c0c0da..f52bdb16 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001 Internet Software Consortium. + * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.218.2.8 2002/02/26 23:24:18 halley Exp $ */ +/* $Id: resolver.c,v 1.218.2.9 2002/03/26 00:54:58 marka Exp $ */ #include <config.h> diff --git a/lib/dns/result.c b/lib/dns/result.c index 693efe07..2bc2d098 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.90.2.2 2001/09/21 23:18:45 gson Exp $ */ +/* $Id: result.c,v 1.90.2.5 2002/03/26 00:55:00 marka Exp $ */ #include <config.h> @@ -120,7 +120,12 @@ static const char *text[DNS_R_NRESULTS] = { "clocks are unsynchronized", /* 76 DNS_R_CLOCKSKEW */ "IXFR failed", /* 77 DNS_R_BADIXFR */ "<unused 78>", /* 78 unused */ - "no valid KEY" /* 79 DNS_R_NOVALIDKEY */ + "no valid KEY", /* 79 DNS_R_NOVALIDKEY */ + + "obsolete", /* 80 DNS_R_OBSOLETE */ + "already frozen", /* 81 DNS_R_FROZEN */ + "unknown flag", /* 82 DNS_R_UNKNOWNFLAG */ + "expected a response" /* 83 DNS_R_EXPECTEDRESPONSE */ }; static const char *rcode_text[DNS_R_NRCODERESULTS] = { @@ -230,6 +235,7 @@ dns_result_torcode(isc_result_t result) { rcode = dns_rcode_refused; break; case DNS_R_TSIGVERIFYFAILURE: + case DNS_R_CLOCKSKEW: rcode = dns_rcode_notauth; break; default: diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index 53172d7e..574d64c3 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001 Internet Software Consortium. + * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ */ /* - * $Id: tsig.c,v 1.112.2.1 2001/09/27 23:17:10 gson Exp $ + * $Id: tsig.c,v 1.112.2.3 2002/03/26 00:55:01 marka Exp $ */ #include <config.h> @@ -910,9 +910,11 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) { REQUIRE(msg != NULL); REQUIRE(dns_message_gettsigkey(msg) != NULL); REQUIRE(msg->tcp_continuation == 1); - REQUIRE(is_response(msg)); REQUIRE(msg->querytsig != NULL); + if (!is_response(msg)) + return (DNS_R_EXPECTEDRESPONSE); + mctx = msg->mctx; tsigkey = dns_message_gettsigkey(msg); diff --git a/lib/dns/zone.c b/lib/dns/zone.c index c8afba04..2581261b 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.333.2.7 2002/02/08 03:57:31 marka Exp $ */ +/* $Id: zone.c,v 1.333.2.8 2002/03/29 00:20:07 marka Exp $ */ #include <config.h> @@ -4563,7 +4563,9 @@ notify_done(isc_task_t *task, isc_event_t *event) { notify->flags |= DNS_NOTIFY_NOSOA; notify->attempt++; dns_request_destroy(¬ify->request); - notify_send_queue(notify); + result = notify_send_queue(notify); + if (result != ISC_R_SUCCESS) + notify_destroy(notify, ISC_FALSE); } else { if (result == ISC_R_TIMEDOUT) notify_log(notify->zone, ISC_LOG_DEBUG(1), diff --git a/lib/isc/api b/lib/isc/api index 38cabc1d..a2d21190 100644 --- a/lib/isc/api +++ b/lib/isc/api @@ -1,3 +1,3 @@ -LIBINTERFACE = 4 -LIBREVISION = 1 -LIBAGE = 0 +LIBINTERFACE = 5 +LIBREVISION = 0 +LIBAGE = 1 diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h index 685385ee..b990debe 100644 --- a/lib/isc/include/isc/result.h +++ b/lib/isc/include/isc/result.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.57 2001/06/15 22:07:51 gson Exp $ */ +/* $Id: result.h,v 1.57.2.2 2002/03/26 00:55:09 marka Exp $ */ #ifndef ISC_RESULT_H #define ISC_RESULT_H 1 @@ -78,11 +78,13 @@ #define ISC_R_UNBALANCEDQUOTES 52 /* unbalanced quotes */ #define ISC_R_INPROGRESS 53 /* operation in progress */ #define ISC_R_CONNECTIONRESET 54 /* connection reset */ +#define ISC_R_SOFTQUOTA 55 /* soft quota reached */ +#define ISC_R_BADNUMBER 56 /* not a valid number */ /* * Not a result code: the number of results. */ -#define ISC_R_NRESULTS 55 +#define ISC_R_NRESULTS 57 ISC_LANG_BEGINDECLS diff --git a/lib/isc/inet_pton.c b/lib/isc/inet_pton.c index 789403dc..f05d1331 100644 --- a/lib/isc/inet_pton.c +++ b/lib/isc/inet_pton.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1996-2001 Internet Software Consortium. + * Copyright (C) 1996-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -17,7 +17,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = - "$Id: inet_pton.c,v 1.10 2001/07/16 03:06:52 marka Exp $"; + "$Id: inet_pton.c,v 1.10.2.2 2002/03/26 00:55:06 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include <config.h> @@ -51,11 +51,7 @@ static int inet_pton6(const char *src, unsigned char *dst); * Paul Vixie, 1996. */ int -isc_net_pton(af, src, dst) - int af; - const char *src; - void *dst; -{ +isc_net_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: return (inet_pton4(src, dst)); @@ -79,10 +75,7 @@ isc_net_pton(af, src, dst) * Paul Vixie, 1996. */ static int -inet_pton4(src, dst) - const char *src; - unsigned char *dst; -{ +inet_pton4(const char *src, unsigned char *dst) { static const char digits[] = "0123456789"; int saw_digit, octets, ch; unsigned char tmp[NS_INADDRSZ], *tp; @@ -134,10 +127,7 @@ inet_pton4(src, dst) * Paul Vixie, 1996. */ static int -inet_pton6(src, dst) - const char *src; - unsigned char *dst; -{ +inet_pton6(const char *src, unsigned char *dst) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; diff --git a/lib/isc/lex.c b/lib/isc/lex.c index c69a52f2..a440467f 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.c,v 1.66.2.3 2001/12/13 06:17:34 bwelling Exp $ */ +/* $Id: lex.c,v 1.66.2.5 2002/03/26 00:55:07 marka Exp $ */ #include <config.h> @@ -812,6 +812,8 @@ isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, if (token->type == isc_tokentype_eol || token->type == isc_tokentype_eof) return (ISC_R_UNEXPECTEDEND); + if (expect == isc_tokentype_number) + return (ISC_R_BADNUMBER); return (ISC_R_UNEXPECTEDTOKEN); } return (ISC_R_SUCCESS); diff --git a/lib/isc/mem.c b/lib/isc/mem.c index 1bd39b1f..431dc8c2 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.c,v 1.98.2.4 2002/02/08 03:57:39 marka Exp $ */ +/* $Id: mem.c,v 1.98.2.5 2002/03/20 22:51:43 marka Exp $ */ #include <config.h> @@ -1559,7 +1559,11 @@ isc__mempool_put(isc_mempool_t *mpctx, void *mem FLARG) { INSIST(mpctx->allocated > 0); mpctx->allocated--; +#if ISC_MEM_TRACKLINES + LOCK(&mctx->lock); DELETE_TRACE(mctx, mem, mpctx->size, file, line); + UNLOCK(&mctx->lock); +#endif /* ISC_MEM_TRACKLINES */ /* * If our free list is full, return this to the mctx directly. diff --git a/lib/isc/result.c b/lib/isc/result.c index 085382f8..b2e9d1c3 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.56 2001/06/15 22:07:50 gson Exp $ */ +/* $Id: result.c,v 1.56.2.2 2002/03/26 00:55:08 marka Exp $ */ #include <config.h> @@ -92,7 +92,9 @@ static const char *text[ISC_R_NRESULTS] = { "not blocking", /* 51 */ "unbalanced quotes", /* 52 */ "operation in progress", /* 53 */ - "connection reset" /* 54 */ + "connection reset", /* 54 */ + "soft quota reached", /* 55 */ + "not a valid number" /* 56 */ }; #define ISC_RESULT_RESULTSET 2 diff --git a/lib/isc/task.c b/lib/isc/task.c index 3e1cb9dc..2dfcc5c9 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: task.c,v 1.85 2001/06/04 19:33:28 tale Exp $ */ +/* $Id: task.c,v 1.85.2.1 2002/03/29 01:41:01 marka Exp $ */ /* * Principal Author: Bob Halley @@ -1211,6 +1211,7 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) { UNLOCK(&manager->lock); while (isc__taskmgr_ready()) (void)isc__taskmgr_dispatch(); + INSIST(ISC_LIST_EMPTY(manager->tasks)); #endif /* ISC_PLATFORM_USETHREADS */ manager_free(manager); diff --git a/lib/isc/unix/errno2result.c b/lib/isc/unix/errno2result.c index 8b0f1c42..ced3dba5 100644 --- a/lib/isc/unix/errno2result.c +++ b/lib/isc/unix/errno2result.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: errno2result.c,v 1.8.2.2 2002/02/20 02:17:27 marka Exp $ */ +/* $Id: errno2result.c,v 1.8.2.3 2002/03/20 20:59:39 marka Exp $ */ #include <config.h> @@ -100,6 +100,8 @@ isc__errno2result(int posixerrno) { case EADDRINUSE: return (ISC_R_ADDRINUSE); #endif + case EADDRNOTAVAIL: + return (ISC_R_ADDRNOTAVAIL); default: isc__strerror(posixerrno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index ae499f7d..462d2eff 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.207.2.9 2002/02/08 03:57:42 marka Exp $ */ +/* $Id: socket.c,v 1.207.2.10 2002/03/20 20:56:44 marka Exp $ */ #include <config.h> @@ -929,6 +929,8 @@ doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) { SOFT_OR_HARD(ENETUNREACH, ISC_R_NETUNREACH); SOFT_OR_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH); SOFT_OR_HARD(EHOSTDOWN, ISC_R_HOSTDOWN); + /* HPUX 11.11 can return EADDRNOTAVAIL. */ + SOFT_OR_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES); #undef SOFT_OR_HARD diff --git a/lib/isc/win32/file.c b/lib/isc/win32/file.c index 10926952..32dada2a 100644 --- a/lib/isc/win32/file.c +++ b/lib/isc/win32/file.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001 Internet Software Consortium. + * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: file.c,v 1.20.2.2 2001/09/05 17:29:25 gson Exp $ */ +/* $Id: file.c,v 1.20.2.4 2002/03/26 00:55:11 marka Exp $ */ #include <config.h> @@ -302,6 +302,8 @@ isc_file_renameunique(const char *file, char *templet) { fd = mkstemp(templet); if (fd == -1) result = isc__errno2result(errno); + else + close(fd); if (result == ISC_R_SUCCESS) { res = isc_file_safemovefile(file, templet); @@ -310,8 +312,6 @@ isc_file_renameunique(const char *file, char *templet) { (void)unlink(templet); } } - if (fd != -1) - close(fd); return (result); } diff --git a/lib/isc/win32/include/isc/strerror.h b/lib/isc/win32/include/isc/strerror.h index 662e82c2..4678404f 100644 --- a/lib/isc/win32/include/isc/strerror.h +++ b/lib/isc/win32/include/isc/strerror.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 Internet Software Consortium. + * Copyright (C) 2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: strerror.h,v 1.2.2.1 2002/02/27 07:20:25 marka Exp $ */ +/* $Id: strerror.h,v 1.2.2.2 2002/03/26 00:55:12 marka Exp $ */ #ifndef ISC_STRERROR_H #define ISC_STRERROR_H diff --git a/lib/isccc/api b/lib/isccc/api index 494278e7..06977fcb 100644 --- a/lib/isccc/api +++ b/lib/isccc/api @@ -1,3 +1,3 @@ LIBINTERFACE = 0 -LIBREVISION = 0 +LIBREVISION = 1 LIBAGE = 0 diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c index 2324cd37..9ac82ad7 100644 --- a/lib/isccc/cc.c +++ b/lib/isccc/cc.c @@ -1,6 +1,6 @@ /* - * Portions Copyright (C) 2001 Internet Software Consortium. - * Portions Copyright (C) 2001 Nominum, Inc. + * Portions Copyright (C) 2001, 2002 Internet Software Consortium. + * Portions Copyright (C) 2001, 2002 Nominum, Inc. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cc.c,v 1.4 2001/04/12 20:36:53 tale Exp $ */ +/* $Id: cc.c,v 1.4.2.2 2002/03/26 00:55:13 marka Exp $ */ #include <config.h> @@ -558,7 +558,7 @@ isccc_cc_isack(isccc_sexpr_t *message) _ctrl = isccc_alist_lookup(message, "_ctrl"); if (_ctrl == NULL) - return (ISC_R_FAILURE); + return (ISC_FALSE); if (isccc_cc_lookupstring(_ctrl, "_ack", NULL) == ISC_R_SUCCESS) return (ISC_TRUE); return (ISC_FALSE); @@ -571,7 +571,7 @@ isccc_cc_isreply(isccc_sexpr_t *message) _ctrl = isccc_alist_lookup(message, "_ctrl"); if (_ctrl == NULL) - return (ISC_R_FAILURE); + return (ISC_FALSE); if (isccc_cc_lookupstring(_ctrl, "_rpl", NULL) == ISC_R_SUCCESS) return (ISC_TRUE); return (ISC_FALSE); diff --git a/lib/isccfg/api b/lib/isccfg/api index 06977fcb..7931195a 100644 --- a/lib/isccfg/api +++ b/lib/isccfg/api @@ -1,3 +1,3 @@ LIBINTERFACE = 0 -LIBREVISION = 1 +LIBREVISION = 2 LIBAGE = 0 diff --git a/lib/isccfg/check.c b/lib/isccfg/check.c index 0e2d2606..2fe46e3a 100644 --- a/lib/isccfg/check.c +++ b/lib/isccfg/check.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check.c,v 1.14.2.14 2002/02/19 22:30:05 gson Exp $ */ +/* $Id: check.c,v 1.14.2.15 2002/03/20 20:21:15 marka Exp $ */ #include <config.h> @@ -25,7 +25,9 @@ #include <isc/buffer.h> #include <isc/log.h> #include <isc/mem.h> +#include <isc/netaddr.h> #include <isc/result.h> +#include <isc/sockaddr.h> #include <isc/symtab.h> #include <isc/util.h> @@ -392,10 +394,46 @@ freekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) { UNUSED(value); isc_mem_free(userarg, key); } - + +static isc_result_t +check_servers(cfg_obj_t *servers, isc_log_t *logctx) { + isc_result_t result = ISC_R_SUCCESS; + cfg_listelt_t *e1, *e2; + cfg_obj_t *v1, *v2; + isc_sockaddr_t *s1, *s2; + isc_netaddr_t na; + + for (e1 = cfg_list_first(servers); e1 != NULL; e1 = cfg_list_next(e1)) { + v1 = cfg_listelt_value(e1); + s1 = cfg_obj_assockaddr(cfg_map_getname(v1)); + e2 = e1; + while ((e2 = cfg_list_next(e2)) != NULL) { + v2 = cfg_listelt_value(e2); + s2 = cfg_obj_assockaddr(cfg_map_getname(v2)); + if (isc_sockaddr_eqaddr(s1, s2)) { + isc_buffer_t target; + char buf[128]; + + isc_netaddr_fromsockaddr(&na, s2); + isc_buffer_init(&target, buf, sizeof(buf) - 1); + INSIST(isc_netaddr_totext(&na, &target) + == ISC_R_SUCCESS); + buf[isc_buffer_usedlength(&target)] = '\0'; + + cfg_obj_log(v2, logctx, ISC_LOG_ERROR, + "server '%s': already exists", + buf); + result = ISC_R_FAILURE; + } + } + } + return (result); +} + static isc_result_t check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, isc_log_t *logctx, isc_mem_t *mctx) { + cfg_obj_t *servers = NULL; cfg_obj_t *zones = NULL; cfg_obj_t *keys = NULL; cfg_listelt_t *element; @@ -474,6 +512,14 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, isc_log_t *logctx, isc_mem result = ISC_R_FAILURE; } + + if (vconfig != NULL) { + (void)cfg_map_get(vconfig, "server", &servers); + if (servers != NULL && + check_servers(servers, logctx) != ISC_R_SUCCESS) + result = ISC_R_FAILURE; + } + if (vconfig != NULL) tresult = check_options(vconfig, logctx); else @@ -488,6 +534,7 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, isc_log_t *logctx, isc_mem isc_result_t cfg_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) { cfg_obj_t *options = NULL; + cfg_obj_t *servers = NULL; cfg_obj_t *views = NULL; cfg_obj_t *acls = NULL; cfg_obj_t *obj; @@ -504,6 +551,11 @@ cfg_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) { check_options(options, logctx) != ISC_R_SUCCESS) result = ISC_R_FAILURE; + (void)cfg_map_get(config, "server", &servers); + if (servers != NULL && + check_servers(servers, logctx) != ISC_R_SUCCESS) + result = ISC_R_FAILURE; + (void)cfg_map_get(config, "view", &views); if (views == NULL) { diff --git a/make/rules.in b/make/rules.in index ba830063..86e42869 100644 --- a/make/rules.in +++ b/make/rules.in @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2001 Internet Software Consortium. +# Copyright (C) 1998-2002 Internet Software Consortium. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -13,7 +13,7 @@ # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# $Id: rules.in,v 1.40 2001/08/29 04:15:03 marka Exp $ +# $Id: rules.in,v 1.40.2.2 2002/03/26 00:55:15 marka Exp $ ### ### Common Makefile rules for BIND 9. @@ -70,6 +70,8 @@ subdirs: fi; \ done +install:: all + install clean distclean maintainer-clean doc docclean man manclean:: @for i in ${ALL_SUBDIRS}; do \ if [ "$$i" != "nulldir" -a -d $$i ]; then \ @@ -1,4 +1,4 @@ -# $Id: version,v 1.26.2.11 2002/01/25 03:04:22 marka Exp $ +# $Id: version,v 1.26.2.12 2002/03/15 05:14:11 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=2 PATCHVER=1 RELEASETYPE=rc -RELEASEVER=1 +RELEASEVER=2 |