diff options
Diffstat (limited to 'contrib/bind9/bin')
25 files changed, 337 insertions, 134 deletions
diff --git a/contrib/bind9/bin/check/check-tool.c b/contrib/bind9/bin/check/check-tool.c index cefee82..1b67ca8 100644 --- a/contrib/bind9/bin/check/check-tool.c +++ b/contrib/bind9/bin/check/check-tool.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check-tool.c,v 1.4.12.5 2004/03/08 04:04:13 marka Exp $ */ +/* $Id: check-tool.c,v 1.4.12.7 2004/11/30 01:15:40 marka Exp $ */ #include <config.h> @@ -32,6 +32,7 @@ #include <isc/types.h> #include <dns/fixedname.h> +#include <dns/log.h> #include <dns/name.h> #include <dns/rdataclass.h> #include <dns/types.h> @@ -48,7 +49,9 @@ static const char *dbtype[] = { "rbt" }; int debug = 0; isc_boolean_t nomerge = ISC_TRUE; -unsigned int zone_options = DNS_ZONEOPT_CHECKNS|DNS_ZONEOPT_MANYERRORS; +unsigned int zone_options = DNS_ZONEOPT_CHECKNS | + DNS_ZONEOPT_MANYERRORS | + DNS_ZONEOPT_CHECKNAMES; isc_result_t setup_logging(isc_mem_t *mctx, isc_log_t **logp) { diff --git a/contrib/bind9/bin/check/named-checkconf.c b/contrib/bind9/bin/check/named-checkconf.c index 88a7299..e7f9138 100644 --- a/contrib/bind9/bin/check/named-checkconf.c +++ b/contrib/bind9/bin/check/named-checkconf.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named-checkconf.c,v 1.12.12.7 2004/03/08 09:04:14 marka Exp $ */ +/* $Id: named-checkconf.c,v 1.12.12.9 2005/03/03 06:33:38 marka Exp $ */ #include <config.h> @@ -25,6 +25,8 @@ #include <isc/commandline.h> #include <isc/dir.h> +#include <isc/entropy.h> +#include <isc/hash.h> #include <isc/log.h> #include <isc/mem.h> #include <isc/result.h> @@ -35,6 +37,7 @@ #include <bind9/check.h> +#include <dns/fixedname.h> #include <dns/log.h> #include <dns/result.h> @@ -203,6 +206,7 @@ main(int argc, char **argv) { isc_mem_t *mctx = NULL; isc_result_t result; int exit_status = 0; + isc_entropy_t *ectx = NULL; isc_boolean_t load_zones = ISC_FALSE; while ((c = isc_commandline_parse(argc, argv, "djt:vz")) != EOF) { @@ -252,6 +256,10 @@ main(int argc, char **argv) { RUNTIME_CHECK(setup_logging(mctx, &logc) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE) + == ISC_R_SUCCESS); + dns_result_register(); RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS); @@ -280,6 +288,9 @@ main(int argc, char **argv) { isc_log_destroy(&logc); + isc_hash_destroy(); + isc_entropy_detach(&ectx); + isc_mem_destroy(&mctx); return (exit_status); diff --git a/contrib/bind9/bin/check/named-checkzone.c b/contrib/bind9/bin/check/named-checkzone.c index d023bd6..0eea166 100644 --- a/contrib/bind9/bin/check/named-checkzone.c +++ b/contrib/bind9/bin/check/named-checkzone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named-checkzone.c,v 1.13.2.3.8.9 2004/03/06 10:21:11 marka Exp $ */ +/* $Id: named-checkzone.c,v 1.13.2.3.8.11 2004/10/25 01:36:06 marka Exp $ */ #include <config.h> @@ -24,6 +24,8 @@ #include <isc/app.h> #include <isc/commandline.h> #include <isc/dir.h> +#include <isc/entropy.h> +#include <isc/hash.h> #include <isc/log.h> #include <isc/mem.h> #include <isc/socket.h> @@ -44,6 +46,7 @@ static int quiet = 0; static isc_mem_t *mctx = NULL; +static isc_entropy_t *ectx = NULL; dns_zone_t *zone = NULL; dns_zonetype_t zonetype = dns_zone_master; static int dumpzone = 0; @@ -63,7 +66,8 @@ static void usage(void) { fprintf(stderr, "usage: named-checkzone [-djqvD] [-c class] [-o output] " - "[-t directory] [-w directory] [-k option] zonename filename\n"); + "[-t directory] [-w directory] [-k (ignore|warn|fail)] " + "[-n (ignore|warn|fail)] zonename filename\n"); exit(1); } @@ -111,12 +115,17 @@ main(int argc, char **argv) { break; case 'k': - if (!strcmp(isc_commandline_argument, "check-names")) { + if (!strcmp(isc_commandline_argument, "warn")) { zone_options |= DNS_ZONEOPT_CHECKNAMES; + zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL; } else if (!strcmp(isc_commandline_argument, - "check-names-fail")) { + "fail")) { zone_options |= DNS_ZONEOPT_CHECKNAMES | DNS_ZONEOPT_CHECKNAMESFAIL; + } else if (!strcmp(isc_commandline_argument, + "ignore")) { + zone_options &= ~(DNS_ZONEOPT_CHECKNAMES | + DNS_ZONEOPT_CHECKNAMESFAIL); } break; @@ -179,6 +188,9 @@ main(int argc, char **argv) { dns_log_init(lctx); dns_log_setcontext(lctx); } + RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE) + == ISC_R_SUCCESS); dns_result_register(); @@ -195,6 +207,8 @@ main(int argc, char **argv) { destroy(); if (lctx != NULL) isc_log_destroy(&lctx); + isc_hash_destroy(); + isc_entropy_detach(&ectx); isc_mem_destroy(&mctx); return ((result == ISC_R_SUCCESS) ? 0 : 1); } diff --git a/contrib/bind9/bin/dig/dig.c b/contrib/bind9/bin/dig/dig.c index b2c4625..08f5b5b 100644 --- a/contrib/bind9/bin/dig/dig.c +++ b/contrib/bind9/bin/dig/dig.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.c,v 1.157.2.13.2.20 2004/06/23 04:19:40 marka Exp $ */ +/* $Id: dig.c,v 1.157.2.13.2.25 2004/09/16 02:14:14 marka Exp $ */ #include <config.h> #include <stdlib.h> @@ -41,6 +41,8 @@ #include <dns/rdataclass.h> #include <dns/result.h> +#include <bind9/getaddresses.h> + #include <dig/dig.h> extern ISC_LIST(dig_lookup_t) lookup_list; @@ -54,6 +56,7 @@ extern ISC_LIST(dig_searchlist_t) search_list; isc_buffer_putstr(b, s); \ } +#define DIG_MAX_ADDRESSES 20 extern isc_boolean_t have_ipv4, have_ipv6, specified_source, usesearch, qr; @@ -83,6 +86,7 @@ extern isc_boolean_t debugging, memdebugging; static char *batchname = NULL; static FILE *batchfp = NULL; static char *argv0; +static int addresscount = 0; static char domainopt[DNS_NAME_MAXTEXT]; @@ -627,6 +631,15 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) { remaining = sizeof(lookup->cmdline) - strlen(lookup->cmdline) - 1; strncat(lookup->cmdline, "\n", remaining); + if (first && addresscount != 0) { + snprintf(append, sizeof(append), + "; (%d server%s found)\n", + addresscount, + addresscount > 1 ? "s" : ""); + remaining = sizeof(lookup->cmdline) - + strlen(lookup->cmdline) - 1; + strncat(lookup->cmdline, append, remaining); + } if (first) { snprintf(append, sizeof(append), ";; global options: %s %s\n", @@ -1008,7 +1021,7 @@ plus_option(char *option, isc_boolean_t is_batchfile, lookup->stats = ISC_FALSE; lookup->section_additional = ISC_FALSE; lookup->section_authority = ISC_TRUE; - lookup->section_question = ISC_FALSE; + lookup->section_question = ISC_FALSE; } break; case 'i': /* tries */ @@ -1024,6 +1037,7 @@ plus_option(char *option, isc_boolean_t is_batchfile, break; #ifdef DIG_SIGCHASE case 'u': /* trusted-key */ + FULLCHECK("trusted-key"); if (value == NULL) goto need_value; if (!state) @@ -1068,8 +1082,7 @@ static const char *single_dash_opts = "46dhimnv"; static const char *dash_opts = "46bcdfhikmnptvyx"; static isc_boolean_t dash_option(char *option, char *next, dig_lookup_t **lookup, - isc_boolean_t *open_type_class, isc_boolean_t *firstarg, - int argc, char **argv) + isc_boolean_t *open_type_class) { char opt, *value, *ptr; isc_result_t result; @@ -1274,10 +1287,6 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, if (!(*lookup)->rdclassset) (*lookup)->rdclass = dns_rdataclass_in; (*lookup)->new_search = ISC_TRUE; - if (*lookup && *firstarg) { - printgreeting(argc, argv, *lookup); - *firstarg = ISC_FALSE; - } ISC_LIST_APPEND(lookup_list, *lookup, link); } else { fprintf(stderr, "Invalid IP address %s\n", value); @@ -1325,12 +1334,35 @@ preparse_args(int argc, char **argv) { } static void +getaddresses(dig_lookup_t *lookup, const char *host) { + isc_result_t result; + isc_sockaddr_t sockaddrs[DIG_MAX_ADDRESSES]; + isc_netaddr_t netaddr; + int count, i; + dig_server_t *srv; + char tmp[ISC_NETADDR_FORMATSIZE]; + + result = bind9_getaddresses(host, 0, sockaddrs, + DIG_MAX_ADDRESSES, &count); + if (result != ISC_R_SUCCESS) + fatal("couldn't get address for '%s': %s", + host, isc_result_totext(result)); + + for (i = 0; i < count; i++) { + isc_netaddr_fromsockaddr(&netaddr, &sockaddrs[i]); + isc_netaddr_format(&netaddr, tmp, sizeof(tmp)); + srv = make_server(tmp, host); + ISC_LIST_APPEND(lookup->my_server_list, srv, link); + } + addresscount = count; +} + +static void parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, int argc, char **argv) { isc_result_t result; isc_textregion_t tr; isc_boolean_t firstarg = ISC_TRUE; - dig_server_t *srv = NULL; dig_lookup_t *lookup = NULL; dns_rdatatype_t rdtype; dns_rdataclass_t rdclass; @@ -1410,24 +1442,20 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, if (strncmp(rv[0], "%", 1) == 0) break; if (strncmp(rv[0], "@", 1) == 0) { - srv = make_server(&rv[0][1]); - ISC_LIST_APPEND(lookup->my_server_list, - srv, link); + getaddresses(lookup, &rv[0][1]); } else if (rv[0][0] == '+') { plus_option(&rv[0][1], is_batchfile, lookup); } else if (rv[0][0] == '-') { if (rc <= 1) { if (dash_option(&rv[0][1], NULL, - &lookup, &open_type_class, - &firstarg, argc, argv)) { + &lookup, &open_type_class)) { rc--; rv++; } } else { if (dash_option(&rv[0][1], rv[1], - &lookup, &open_type_class, - &firstarg, argc, argv)) { + &lookup, &open_type_class)) { rc--; rv++; } @@ -1498,10 +1526,6 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, if (!config_only) { lookup = clone_lookup(default_lookup, ISC_TRUE); - if (firstarg) { - printgreeting(argc, argv, lookup); - firstarg = ISC_FALSE; - } strncpy(lookup->textname, rv[0], sizeof(lookup->textname)); lookup->textname[sizeof(lookup->textname)-1]=0; @@ -1568,6 +1592,9 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, firstarg = ISC_FALSE; } ISC_LIST_APPEND(lookup_list, lookup, link); + } else if (!config_only && firstarg) { + printgreeting(argc, argv, lookup); + firstarg = ISC_FALSE; } } diff --git a/contrib/bind9/bin/dig/dighost.c b/contrib/bind9/bin/dig/dighost.c index dd49b5b..63a8110 100644 --- a/contrib/bind9/bin/dig/dighost.c +++ b/contrib/bind9/bin/dig/dighost.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.221.2.19.2.14 2004/06/30 23:57:52 marka Exp $ */ +/* $Id: dighost.c,v 1.221.2.19.2.20 2004/11/22 23:30:31 marka Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -290,6 +290,8 @@ struct_tk_list tk_list = { {NULL, NULL, NULL, NULL, NULL}, 0}; #endif +#define DIG_MAX_ADDRESSES 20 + /* * Apply and clear locks at the event level in global task. * Can I get rid of these using shutdown events? XXX @@ -493,7 +495,7 @@ check_result(isc_result_t result, const char *msg) { * of finding the answer the user is looking for */ dig_server_t * -make_server(const char *servname) { +make_server(const char *servname, const char *userarg) { dig_server_t *srv; REQUIRE(servname != NULL); @@ -504,10 +506,13 @@ make_server(const char *servname) { fatal("memory allocation failure in %s:%d", __FILE__, __LINE__); strncpy(srv->servername, servname, MXNAME); + strncpy(srv->userarg, userarg, MXNAME); srv->servername[MXNAME-1] = 0; + srv->userarg[MXNAME-1] = 0; ISC_LINK_INIT(srv, link); return (srv); } + static int addr2af(int lwresaddrtype) { @@ -525,6 +530,7 @@ addr2af(int lwresaddrtype) return (af); } + /* * Create a copy of the server list from the lwres configuration structure. * The dest list must have already had ISC_LIST_INIT applied. @@ -542,11 +548,12 @@ copy_server_list(lwres_conf_t *confdata, dig_serverlist_t *dest) { lwres_net_ntop(af, confdata->nameservers[i].address, tmp, sizeof(tmp)); - newsrv = make_server(tmp); + newsrv = make_server(tmp, tmp); ISC_LINK_INIT(newsrv, link); ISC_LIST_ENQUEUE(*dest, newsrv, link); } } + void flush_server_list(void) { dig_server_t *s, *ps; @@ -560,18 +567,35 @@ flush_server_list(void) { isc_mem_free(mctx, ps); } } + void set_nameserver(char *opt) { + isc_result_t result; + isc_sockaddr_t sockaddrs[DIG_MAX_ADDRESSES]; + isc_netaddr_t netaddr; + int count, i; dig_server_t *srv; + char tmp[ISC_NETADDR_FORMATSIZE]; if (opt == NULL) return; + result = bind9_getaddresses(opt, 0, sockaddrs, + DIG_MAX_ADDRESSES, &count); + if (result != ISC_R_SUCCESS) + fatal("couldn't get address for '%s': %s", + opt, isc_result_totext(result)); + flush_server_list(); - srv = make_server(opt); - if (srv == NULL) - fatal("memory allocation failure"); - ISC_LIST_INITANDAPPEND(server_list, srv, link); + + for (i = 0; i < count; i++) { + isc_netaddr_fromsockaddr(&netaddr, &sockaddrs[i]); + isc_netaddr_format(&netaddr, tmp, sizeof(tmp)); + srv = make_server(tmp, opt); + if (srv == NULL) + fatal("memory allocation failure"); + ISC_LIST_APPEND(server_list, srv, link); + } } static isc_result_t @@ -613,7 +637,7 @@ clone_server_list(dig_serverlist_t src, dig_serverlist_t *dest) { debug("clone_server_list()"); srv = ISC_LIST_HEAD(src); while (srv != NULL) { - newsrv = make_server(srv->servername); + newsrv = make_server(srv->servername, srv->userarg); ISC_LINK_INIT(newsrv, link); ISC_LIST_ENQUEUE(*dest, newsrv, link); srv = ISC_LIST_NEXT(srv, link); @@ -1392,6 +1416,13 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) name = NULL; dns_message_currentname(msg, section, &name); + if (section == DNS_SECTION_AUTHORITY) { + rdataset = NULL; + result = dns_message_findtype(name, dns_rdatatype_soa, + 0, &rdataset); + if (result == ISC_R_SUCCESS) + return (0); + } rdataset = NULL; result = dns_message_findtype(name, dns_rdatatype_ns, 0, &rdataset); @@ -1436,7 +1467,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) query->lookup->ns_search_only; lookup->trace_root = ISC_FALSE; } - srv = make_server(namestr); + srv = make_server(namestr, namestr); debug("adding server %s", srv->servername); ISC_LIST_APPEND(lookup->my_server_list, srv, link); dns_rdata_reset(&rdata); @@ -1800,6 +1831,7 @@ setup_lookup(dig_lookup_t *lookup) { query->first_rr_serial = 0; query->second_rr_serial = 0; query->servname = serv->servername; + query->userarg = serv->userarg; query->rr_count = 0; query->msg_count = 0; ISC_LINK_INIT(query, link); @@ -2581,11 +2613,26 @@ recv_done(isc_task_t *task, isc_event_t *event) { else isc_sockaddr_any6(&any); +#ifdef ISC_PLATFORM_HAVESCOPEID /* - * We don't expect a match when the packet is - * sent to 0.0.0.0, :: or to a multicast addresses. - * XXXMPA broadcast needs to be handled here as well. - */ + * Accept answers from any scope if we havn't specified the + * scope as long as the address and port match. + */ + if (isc_sockaddr_pf(&query->sockaddr) == AF_INET6 && + query->sockaddr.type.sin6.sin6_scope_id == 0 && + memcmp(&sevent->address.type.sin6.sin6_addr, + &query->sockaddr.type.sin6.sin6_addr, + sizeof(query->sockaddr.type.sin6.sin6_addr)) == 0 && + isc_sockaddr_getport(&sevent->address) == + isc_sockaddr_getport(&query->sockaddr)) + /* empty */; + else +#endif + /* + * We don't expect a match above when the packet is + * sent to 0.0.0.0, :: or to a multicast addresses. + * XXXMPA broadcast needs to be handled here as well. + */ if ((!isc_sockaddr_eqaddr(&query->sockaddr, &any) && !isc_sockaddr_ismulticast(&query->sockaddr)) || isc_sockaddr_getport(&query->sockaddr) != @@ -3564,8 +3611,8 @@ get_trusted_key(isc_mem_t *mctx) return ISC_R_FAILURE; } fclose(fptemp); - result = dst_key_fromnamedfile(filetemp, DST_TYPE_PUBLIC | - DST_TYPE_KEY, mctx, &key); + result = dst_key_fromnamedfile(filetemp, DST_TYPE_PUBLIC, + mctx, &key); removetmpkey(mctx, filetemp); isc_mem_free(mctx, filetemp); if (result != ISC_R_SUCCESS ) { @@ -3688,7 +3735,7 @@ prepare_lookup(dns_name_t *name) dns_rdata_reset(&aaaa); - srv = make_server(namestr); + srv = make_server(namestr, namestr); ISC_LIST_APPEND(lookup->my_server_list, srv, link); @@ -3718,7 +3765,7 @@ prepare_lookup(dns_name_t *name) printf("ns name: %s\n", namestr); - srv = make_server(namestr); + srv = make_server(namestr, namestr); ISC_LIST_APPEND(lookup->my_server_list, srv, link); @@ -3730,7 +3777,7 @@ prepare_lookup(dns_name_t *name) printf("ns name: "); dns_name_print(&ns.name, stdout); printf("\n"); - srv = make_server(namestr); + srv = make_server(namestr, namestr); ISC_LIST_APPEND(lookup->my_server_list, srv, link); @@ -4905,7 +4952,7 @@ prove_nx_domain(dns_message_t *msg, dns_rdataset_t * nsecset = NULL; dns_rdataset_t * signsecset = NULL ; dns_rdata_t nsec = DNS_RDATA_INIT; - dns_name_t * nsecname = NULL; + dns_name_t * nsecname; dns_rdata_nsec_t nsecstruct; if ((result = dns_message_firstname(msg, DNS_SECTION_AUTHORITY)) @@ -4916,6 +4963,7 @@ prove_nx_domain(dns_message_t *msg, } do { + nsecname = NULL; dns_message_currentname(msg, DNS_SECTION_AUTHORITY, &nsecname); nsecset = search_type(nsecname, dns_rdatatype_nsec, dns_rdatatype_any); @@ -4961,7 +5009,6 @@ prove_nx_domain(dns_message_t *msg, dns_rdata_freestruct(&nsecstruct); } - nsecname = NULL; } while (dns_message_nextname(msg, DNS_SECTION_AUTHORITY) == ISC_R_SUCCESS); diff --git a/contrib/bind9/bin/dig/host.c b/contrib/bind9/bin/dig/host.c index 53d7812..b8f2d93 100644 --- a/contrib/bind9/bin/dig/host.c +++ b/contrib/bind9/bin/dig/host.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: host.c,v 1.76.2.5.2.9 2004/04/13 03:00:06 marka Exp $ */ +/* $Id: host.c,v 1.76.2.5.2.10 2004/09/06 01:33:05 marka Exp $ */ #include <config.h> #include <limits.h> @@ -386,7 +386,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { char sockstr[ISC_SOCKADDR_FORMATSIZE]; printf("Using domain server:\n"); - printf("Name: %s\n", query->servname); + printf("Name: %s\n", query->userarg); isc_sockaddr_format(&query->sockaddr, sockstr, sizeof(sockstr)); printf("Address: %s\n", sockstr); diff --git a/contrib/bind9/bin/dig/include/dig/dig.h b/contrib/bind9/bin/dig/include/dig/dig.h index 12e1e21..4e88b15 100644 --- a/contrib/bind9/bin/dig/include/dig/dig.h +++ b/contrib/bind9/bin/dig/include/dig/dig.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.h,v 1.71.2.6.2.6 2004/06/19 02:30:12 sra Exp $ */ +/* $Id: dig.h,v 1.71.2.6.2.7 2004/09/06 01:33:06 marka Exp $ */ #ifndef DIG_H #define DIG_H @@ -192,6 +192,7 @@ struct dig_query { isc_uint32_t msg_count; isc_uint32_t rr_count; char *servname; + char *userarg; isc_bufferlist_t sendlist, recvlist, lengthlist; @@ -209,6 +210,7 @@ struct dig_query { struct dig_server { char servername[MXNAME]; + char userarg[MXNAME]; ISC_LINK(dig_server_t) link; }; @@ -272,7 +274,7 @@ dig_lookup_t * clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers); dig_server_t * -make_server(const char *servname); +make_server(const char *servname, const char *userarg); void flush_server_list(void); diff --git a/contrib/bind9/bin/dig/nslookup.c b/contrib/bind9/bin/dig/nslookup.c index a616bae..b26c605 100644 --- a/contrib/bind9/bin/dig/nslookup.c +++ b/contrib/bind9/bin/dig/nslookup.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nslookup.c,v 1.90.2.4.2.7 2004/08/18 23:25:58 marka Exp $ */ +/* $Id: nslookup.c,v 1.90.2.4.2.8 2004/09/06 01:33:05 marka Exp $ */ #include <config.h> @@ -402,7 +402,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { debug("printmessage()"); isc_sockaddr_format(&query->sockaddr, servtext, sizeof(servtext)); - printf("Server:\t\t%s\n", query->servname); + printf("Server:\t\t%s\n", query->userarg); printf("Address:\t%s\n", servtext); puts(""); @@ -461,7 +461,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) { get_address(srv->servername, port, &sockaddr); isc_sockaddr_format(&sockaddr, sockstr, sizeof(sockstr)); printf("Default server: %s\nAddress: %s\n", - srv->servername, sockstr); + srv->userarg, sockstr); if (!full) return; srv = ISC_LIST_NEXT(srv, link); @@ -738,7 +738,9 @@ get_next_command(void) { setoption(arg); else if ((strcasecmp(ptr, "server") == 0) || (strcasecmp(ptr, "lserver") == 0)) { + isc_app_block(); set_nameserver(arg); + isc_app_unblock(); show_settings(ISC_TRUE, ISC_TRUE); } else if (strcasecmp(ptr, "exit") == 0) { in_use = ISC_FALSE; diff --git a/contrib/bind9/bin/dnssec/dnssec-signzone.c b/contrib/bind9/bin/dnssec/dnssec-signzone.c index 096cd30..c2c33f8 100644 --- a/contrib/bind9/bin/dnssec/dnssec-signzone.c +++ b/contrib/bind9/bin/dnssec/dnssec-signzone.c @@ -16,7 +16,7 @@ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-signzone.c,v 1.139.2.2.4.16 2004/08/28 06:25:29 marka Exp $ */ +/* $Id: dnssec-signzone.c,v 1.139.2.2.4.17 2004/10/25 01:36:06 marka Exp $ */ #include <config.h> @@ -28,6 +28,7 @@ #include <isc/entropy.h> #include <isc/event.h> #include <isc/file.h> +#include <isc/hash.h> #include <isc/mem.h> #include <isc/mutex.h> #include <isc/os.h> @@ -1824,6 +1825,11 @@ main(int argc, char *argv[]) { eflags = ISC_ENTROPY_BLOCKING; if (!pseudorandom) eflags |= ISC_ENTROPY_GOODONLY; + + result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); + if (result != ISC_R_SUCCESS) + fatal("could not create hash context"); + result = dst_lib_init(mctx, ectx, eflags); if (result != ISC_R_SUCCESS) fatal("could not initialize dst"); @@ -2086,6 +2092,7 @@ main(int argc, char *argv[]) { cleanup_logging(&log); dst_lib_destroy(); + isc_hash_destroy(); cleanup_entropy(&ectx); if (verbose > 10) isc_mem_stats(mctx, stdout); diff --git a/contrib/bind9/bin/named/Makefile.in b/contrib/bind9/bin/named/Makefile.in index d95351a..50fb93b 100644 --- a/contrib/bind9/bin/named/Makefile.in +++ b/contrib/bind9/bin/named/Makefile.in @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.74.12.10 2004/08/21 06:22:40 marka Exp $ +# $Id: Makefile.in,v 1.74.12.11 2004/09/06 21:47:25 marka Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -123,9 +123,13 @@ clean distclean maintainer-clean:: installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} + $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5 $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir} (cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@) - for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done + ${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8 + ${INSTALL_DATA} ${srcdir}/lwresd.8 ${DESTDIR}${mandir}/man8 + ${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5 + diff --git a/contrib/bind9/bin/named/client.c b/contrib/bind9/bin/named/client.c index acb9b21..259f8d9 100644 --- a/contrib/bind9/bin/named/client.c +++ b/contrib/bind9/bin/named/client.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.c,v 1.176.2.13.4.22 2004/07/23 02:56:51 marka Exp $ */ +/* $Id: client.c,v 1.176.2.13.4.23 2004/09/26 22:37:43 marka Exp $ */ #include <config.h> @@ -1938,7 +1938,7 @@ client_udprecv(ns_client_t *client) { client->task, client->recvevent, 0); if (result != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_socket_recv() failed: %s", + "isc_socket_recv2() failed: %s", isc_result_totext(result)); /* * This cannot happen in the current implementation, since diff --git a/contrib/bind9/bin/named/config.c b/contrib/bind9/bin/named/config.c index 75158c0..99e5ffa 100644 --- a/contrib/bind9/bin/named/config.c +++ b/contrib/bind9/bin/named/config.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.c,v 1.11.2.4.8.28 2004/08/28 05:41:42 marka Exp $ */ +/* $Id: config.c,v 1.11.2.4.8.29 2004/10/05 02:52:26 marka Exp $ */ #include <config.h> @@ -555,8 +555,8 @@ ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx, if (new == NULL) goto cleanup; if (keycount != 0) { - memcpy(new, keys, newsize); - isc_mem_put(mctx, keys, newsize); + memcpy(new, keys, oldsize); + isc_mem_put(mctx, keys, oldsize); } keys = new; keycount = newlen; diff --git a/contrib/bind9/bin/named/control.c b/contrib/bind9/bin/named/control.c index 8eb7533..b6ff6fe 100644 --- a/contrib/bind9/bin/named/control.c +++ b/contrib/bind9/bin/named/control.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: control.c,v 1.7.2.2.2.10.4.1 2004/09/20 01:00:00 marka Exp $ */ +/* $Id: control.c,v 1.7.2.2.2.11 2004/09/03 03:43:31 marka Exp $ */ #include <config.h> diff --git a/contrib/bind9/bin/named/include/named/control.h b/contrib/bind9/bin/named/include/named/control.h index 9cf4a33..bbb7d36 100644 --- a/contrib/bind9/bin/named/include/named/control.h +++ b/contrib/bind9/bin/named/include/named/control.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: control.h,v 1.6.2.2.2.6.6.1 2004/09/20 01:00:01 marka Exp $ */ +/* $Id: control.h,v 1.6.2.2.2.7 2004/09/03 03:43:32 marka Exp $ */ #ifndef NAMED_CONTROL_H #define NAMED_CONTROL_H 1 diff --git a/contrib/bind9/bin/named/main.c b/contrib/bind9/bin/named/main.c index 432afe5..f78ea24 100644 --- a/contrib/bind9/bin/named/main.c +++ b/contrib/bind9/bin/named/main.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: main.c,v 1.119.2.3.2.16 2004/09/01 07:16:35 marka Exp $ */ +/* $Id: main.c,v 1.119.2.3.2.17 2004/10/25 00:42:54 marka Exp $ */ #include <config.h> @@ -605,6 +605,15 @@ setup(void) { if (!ns_g_foreground) ns_os_daemonize(); + /* + * We call isc_app_start() here as some versions of FreeBSD's fork() + * destroys all the signal handling it sets up. + */ + result = isc_app_start(); + if (result != ISC_R_SUCCESS) + ns_main_earlyfatal("isc_app_start() failed: %s", + isc_result_totext(result)); + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, ISC_LOG_NOTICE, "starting BIND %s%s", ns_g_version, saved_command_line); @@ -801,11 +810,6 @@ main(int argc, char *argv[]) { ns_os_init(program_name); - result = isc_app_start(); - if (result != ISC_R_SUCCESS) - ns_main_earlyfatal("isc_app_start() failed: %s", - isc_result_totext(result)); - dns_result_register(); dst_result_register(); isccc_result_register(); diff --git a/contrib/bind9/bin/named/named.conf.5 b/contrib/bind9/bin/named/named.conf.5 index 1755d5c..2b7387b 100644 --- a/contrib/bind9/bin/named/named.conf.5 +++ b/contrib/bind9/bin/named/named.conf.5 @@ -12,7 +12,7 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.\" $Id: named.conf.5,v 1.1.4.2 2004/08/21 07:35:01 marka Exp $ +.\" $Id: named.conf.5,v 1.1.4.3 2004/10/18 02:33:06 marka Exp $ .\" .TH "NAMED.CONF" "5" "Aug 13, 2004" "BIND9" "" .SH NAME @@ -142,6 +142,7 @@ options { files \fIsize\fR; heartbeat-interval \fIinteger\fR; host-statistics \fIboolean\fR; // not implemented + host-statistics-max \fInumber\fR; // not implemented hostname ( \fIquoted_string\fR | none ); interface-interval \fIinteger\fR; listen-on [ port \fIinteger\fR ] { \fIaddress_match_element\fR; ... }; diff --git a/contrib/bind9/bin/named/named.conf.docbook b/contrib/bind9/bin/named/named.conf.docbook index ba6ac12..b5a71dc 100644 --- a/contrib/bind9/bin/named/named.conf.docbook +++ b/contrib/bind9/bin/named/named.conf.docbook @@ -15,7 +15,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- $Id: named.conf.docbook,v 1.1.4.1 2004/08/20 22:02:38 marka Exp $ --> +<!-- $Id: named.conf.docbook,v 1.1.4.2 2004/10/17 23:19:49 marka Exp $ --> <refentry> <refentryinfo> @@ -177,6 +177,7 @@ options { files <replaceable>size</replaceable>; heartbeat-interval <replaceable>integer</replaceable>; host-statistics <replaceable>boolean</replaceable>; // not implemented + host-statistics-max <replaceable>number</replaceable>; // not implemented hostname ( <replaceable>quoted_string</replaceable> | none ); interface-interval <replaceable>integer</replaceable>; listen-on <optional> port <replaceable>integer</replaceable> </optional> { <replaceable>address_match_element</replaceable>; ... }; diff --git a/contrib/bind9/bin/named/named.conf.html b/contrib/bind9/bin/named/named.conf.html index 9991522..7f8bb2e 100644 --- a/contrib/bind9/bin/named/named.conf.html +++ b/contrib/bind9/bin/named/named.conf.html @@ -14,7 +14,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- $Id: named.conf.html,v 1.1.4.3 2004/08/22 23:38:59 marka Exp $ --> +<!-- $Id: named.conf.html,v 1.1.4.4 2004/10/18 02:33:06 marka Exp $ --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML @@ -470,6 +470,10 @@ CLASS="REPLACEABLE" CLASS="REPLACEABLE" >boolean</VAR >; // not implemented<br> + host-statistics-max <VAR +CLASS="REPLACEABLE" +>number</VAR +>; // not implemented<br> hostname ( <VAR CLASS="REPLACEABLE" >quoted_string</VAR @@ -1038,7 +1042,7 @@ CLASS="REPLACEABLE" ><DIV CLASS="REFSECT1" ><A -NAME="AEN271" +NAME="AEN272" ></A ><H2 >VIEW</H2 @@ -1530,7 +1534,7 @@ CLASS="REPLACEABLE" ><DIV CLASS="REFSECT1" ><A -NAME="AEN397" +NAME="AEN398" ></A ><H2 >ZONE</H2 @@ -1848,7 +1852,7 @@ CLASS="REPLACEABLE" ><DIV CLASS="REFSECT1" ><A -NAME="AEN479" +NAME="AEN480" ></A ><H2 >FILES</H2 @@ -1861,7 +1865,7 @@ CLASS="FILENAME" ><DIV CLASS="REFSECT1" ><A -NAME="AEN483" +NAME="AEN484" ></A ><H2 >SEE ALSO</H2 diff --git a/contrib/bind9/bin/named/server.c b/contrib/bind9/bin/named/server.c index 9080376..d0b6afc 100644 --- a/contrib/bind9/bin/named/server.c +++ b/contrib/bind9/bin/named/server.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.339.2.15.2.56 2004/06/18 04:39:48 marka Exp $ */ +/* $Id: server.c,v 1.339.2.15.2.59 2004/11/10 22:13:56 marka Exp $ */ #include <config.h> @@ -522,6 +522,7 @@ configure_order(dns_order_t *order, cfg_obj_t *ent) { const char *str; isc_buffer_t b; isc_result_t result; + isc_boolean_t addroot; result = ns_config_getclass(cfg_tuple_get(ent, "class"), dns_rdataclass_any, &rdclass); @@ -538,11 +539,12 @@ configure_order(dns_order_t *order, cfg_obj_t *ent) { str = cfg_obj_asstring(obj); else str = "*"; + addroot = ISC_TF(strcmp(str, "*") == 0); isc_buffer_init(&b, str, strlen(str)); isc_buffer_add(&b, strlen(str)); dns_fixedname_init(&fixed); result = dns_name_fromtext(dns_fixedname_name(&fixed), &b, - dns_rootname, ISC_FALSE, NULL); + dns_rootname, ISC_FALSE, NULL); if (result != ISC_R_SUCCESS) return (result); @@ -558,6 +560,18 @@ configure_order(dns_order_t *order, cfg_obj_t *ent) { else INSIST(0); + /* + * "*" should match everything including the root (BIND 8 compat). + * As dns_name_matcheswildcard(".", "*.") returns FALSE add a + * explict entry for "." when the name is "*". + */ + if (addroot) { + result = dns_order_add(order, dns_rootname, + rdtype, rdclass, mode); + if (result != ISC_R_SUCCESS) + return (result); + } + return (dns_order_add(order, dns_fixedname_name(&fixed), rdtype, rdclass, mode)); } @@ -1903,7 +1917,8 @@ adjust_interfaces(ns_server_t *server, isc_mem_t *mctx) { dns_dispatch_t *dispatch6; dispatch6 = dns_resolver_dispatchv6(view->resolver); - INSIST(dispatch6 != NULL); + if (dispatch6 == NULL) + continue; result = dns_dispatch_getlocaladdress(dispatch6, &addr); if (result != ISC_R_SUCCESS) goto fail; @@ -2805,7 +2820,7 @@ run_server(isc_task_t *task, isc_event_t *event) { isc_result_t result; ns_server_t *server = (ns_server_t *)event->ev_arg; - UNUSED(task); + INSIST(task == server->task); isc_event_free(&event); @@ -2843,11 +2858,11 @@ run_server(isc_task_t *task, isc_event_t *event) { isc_hash_init(); - CHECKFATAL(load_zones(server, ISC_FALSE), - "loading zones"); + CHECKFATAL(load_zones(server, ISC_FALSE), "loading zones"); + ns_os_started(); isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, - ISC_LOG_INFO, "running"); + ISC_LOG_NOTICE, "running"); } void @@ -3187,8 +3202,7 @@ loadconfig(ns_server_t *server) { start_reserved_dispatches(server); result = load_configuration(ns_g_lwresdonly ? lwresd_g_conffile : ns_g_conffile, - server, - ISC_FALSE); + server, ISC_FALSE); if (result == ISC_R_SUCCESS) end_reserved_dispatches(server, ISC_FALSE); else diff --git a/contrib/bind9/bin/named/unix/include/named/os.h b/contrib/bind9/bin/named/unix/include/named/os.h index a9fbcb7..03baee5 100644 --- a/contrib/bind9/bin/named/unix/include/named/os.h +++ b/contrib/bind9/bin/named/unix/include/named/os.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.h,v 1.14.2.2.8.8 2004/03/08 04:04:21 marka Exp $ */ +/* $Id: os.h,v 1.14.2.2.8.9 2004/09/29 06:36:44 marka Exp $ */ #ifndef NS_OS_H #define NS_OS_H 1 @@ -61,4 +61,7 @@ ns_os_shutdownmsg(char *command, isc_buffer_t *text); void ns_os_tzset(void); +void +ns_os_started(void); + #endif /* NS_OS_H */ diff --git a/contrib/bind9/bin/named/unix/os.c b/contrib/bind9/bin/named/unix/os.c index 7df7f3b..7977549 100644 --- a/contrib/bind9/bin/named/unix/os.c +++ b/contrib/bind9/bin/named/unix/os.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.c,v 1.46.2.4.8.16 2004/05/04 03:19:42 marka Exp $ */ +/* $Id: os.c,v 1.46.2.4.8.19 2004/10/07 02:34:20 marka Exp $ */ #include <config.h> #include <stdarg.h> @@ -104,6 +104,7 @@ static pid_t mainpid = 0; static struct passwd *runas_pw = NULL; static isc_boolean_t done_setuid = ISC_FALSE; +static int dfd[2] = { -1, -1 }; #ifdef HAVE_LINUX_CAPABILITY_H @@ -161,7 +162,10 @@ linux_setcaps(unsigned int caps) { cap.inheritable = caps; if (syscall(SYS_capset, &caphead, &cap) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); - ns_main_earlyfatal("capset failed: %s", strbuf); + ns_main_earlyfatal("capset failed: %s:" + " please ensure that the capset kernel" + " module is loaded. see insmod(8)", + strbuf); } } @@ -302,13 +306,33 @@ ns_os_daemonize(void) { pid_t pid; char strbuf[ISC_STRERRORSIZE]; + if (pipe(dfd) == -1) { + isc__strerror(errno, strbuf, sizeof(strbuf)); + ns_main_earlyfatal("pipe(): %s", strbuf); + } + pid = fork(); if (pid == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); ns_main_earlyfatal("fork(): %s", strbuf); } - if (pid != 0) - _exit(0); + if (pid != 0) { + int n; + /* + * Wait for the child to finish loading for the first time. + * This would be so much simpler if fork() worked once we + * were multi-threaded. + */ + (void)close(dfd[1]); + do { + char buf; + n = read(dfd[0], &buf, 1); + if (n == 1) + _exit(0); + } while (n == -1 && errno == EINTR); + _exit(1); + } + (void)close(dfd[0]); /* * We're the child. @@ -350,6 +374,20 @@ ns_os_daemonize(void) { } void +ns_os_started(void) { + char buf = 0; + + /* + * Signal to the parent that we stated successfully. + */ + if (dfd[0] != -1 && dfd[1] != -1) { + write(dfd[1], &buf, 1); + close(dfd[1]); + dfd[0] = dfd[1] = -1; + } +} + +void ns_os_opendevnull(void) { devnullfd = open("/dev/null", O_RDWR, 0); } @@ -426,10 +464,14 @@ ns_os_changeuser(void) { #ifdef HAVE_LINUXTHREADS #ifdef HAVE_LINUX_CAPABILITY_H if (!non_root_caps) + ns_main_earlyfatal("-u with Linux threads not supported: " + "requires kernel support for " + "prctl(PR_SET_KEEPCAPS)"); +#else + ns_main_earlyfatal("-u with Linux threads not supported: " + "no capabilities support or capabilities " + "disabled at build time"); #endif - ns_main_earlyfatal( - "-u not supported on Linux kernels older than " - "2.3.99-pre3 or 2.2.18 when using threads"); #endif if (setgid(runas_pw->pw_gid) < 0) { diff --git a/contrib/bind9/bin/named/update.c b/contrib/bind9/bin/named/update.c index 24779b3..325381a 100644 --- a/contrib/bind9/bin/named/update.c +++ b/contrib/bind9/bin/named/update.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.88.2.5.2.23 2004/07/23 02:56:52 marka Exp $ */ +/* $Id: update.c,v 1.88.2.5.2.25 2004/10/21 01:40:22 marka Exp $ */ #include <config.h> @@ -708,7 +708,7 @@ ssu_checkrule(void *data, dns_rdataset_t *rrset) { */ if (rrset->type == dns_rdatatype_rrsig || rrset->type == dns_rdatatype_nsec) - return (ISC_TRUE); + return (ISC_R_SUCCESS); result = dns_ssutable_checkrules(ssuinfo->table, ssuinfo->signer, ssuinfo->name, rrset->type); return (result == ISC_TRUE ? ISC_R_SUCCESS : ISC_R_FAILURE); @@ -965,13 +965,27 @@ typedef struct { */ /* - * Return true iff 'update_rr' is neither a SOA nor an NS RR. + * Return true iff 'db_rr' is neither a SOA nor an NS RR nor + * an RRSIG nor a NSEC. */ static isc_boolean_t type_not_soa_nor_ns_p(dns_rdata_t *update_rr, dns_rdata_t *db_rr) { UNUSED(update_rr); return ((db_rr->type != dns_rdatatype_soa && - db_rr->type != dns_rdatatype_ns) ? + db_rr->type != dns_rdatatype_ns && + db_rr->type != dns_rdatatype_rrsig && + db_rr->type != dns_rdatatype_nsec) ? + ISC_TRUE : ISC_FALSE); +} + +/* + * Return true iff 'db_rr' is neither a RRSIG nor a NSEC. + */ +static isc_boolean_t +type_not_dnssec(dns_rdata_t *update_rr, dns_rdata_t *db_rr) { + UNUSED(update_rr); + return ((db_rr->type != dns_rdatatype_rrsig && + db_rr->type != dns_rdatatype_nsec) ? ISC_TRUE : ISC_FALSE); } @@ -2514,7 +2528,8 @@ update_action(isc_task_t *task, isc_event_t *event) { dns_rdatatype_any, 0, &rdata, &diff)); } else { - CHECK(delete_if(true_p, db, ver, name, + CHECK(delete_if(type_not_dnssec, + db, ver, name, dns_rdatatype_any, 0, &rdata, &diff)); } diff --git a/contrib/bind9/bin/nsupdate/nsupdate.c b/contrib/bind9/bin/nsupdate/nsupdate.c index cb30a5f..3304a3c 100644 --- a/contrib/bind9/bin/nsupdate/nsupdate.c +++ b/contrib/bind9/bin/nsupdate/nsupdate.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsupdate.c,v 1.103.2.15.2.16 2004/06/17 01:00:38 sra Exp $ */ +/* $Id: nsupdate.c,v 1.103.2.15.2.18 2004/09/16 02:12:18 marka Exp $ */ #include <config.h> @@ -627,7 +627,7 @@ parse_args(int argc, char **argv) { exit(1); } if (timeout == 0) - timeout = ULONG_MAX; + timeout = UINT_MAX; break; case 'u': result = isc_parse_uint32(&udp_timeout, @@ -637,7 +637,7 @@ parse_args(int argc, char **argv) { exit(1); } if (udp_timeout == 0) - udp_timeout = ULONG_MAX; + udp_timeout = UINT_MAX; break; case 'r': result = isc_parse_uint32(&udp_retries, @@ -1595,6 +1595,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) { dns_message_t *soaquery = NULL; isc_sockaddr_t *addr; isc_boolean_t seencname = ISC_FALSE; + dns_name_t tname; + unsigned int nlabels; UNUSED(task); @@ -1703,9 +1705,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) { section = DNS_SECTION_ANSWER; else if (pass == 1) section = DNS_SECTION_AUTHORITY; - else - fatal("response to SOA query didn't contain an SOA"); - + else + goto droplabel; result = dns_message_firstname(rcvmsg, section); if (result != ISC_R_SUCCESS) { @@ -1742,29 +1743,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) { goto lookforsoa; } - if (seencname) { - dns_name_t tname; - unsigned int nlabels; - - result = dns_message_firstname(soaquery, DNS_SECTION_QUESTION); - INSIST(result == ISC_R_SUCCESS); - name = NULL; - dns_message_currentname(soaquery, DNS_SECTION_QUESTION, &name); - nlabels = dns_name_countlabels(name); - if (nlabels == 1) - fatal("could not find enclosing zone"); - dns_name_init(&tname, NULL); - dns_name_getlabelsequence(name, 1, nlabels - 1, &tname); - dns_name_clone(&tname, name); - dns_request_destroy(&request); - dns_message_renderreset(soaquery); - if (userserver != NULL) - sendrequest(localaddr, userserver, soaquery, &request); - else - sendrequest(localaddr, &servers[ns_inuse], soaquery, - &request); - goto out; - } + if (seencname) + goto droplabel; if (debugging) { char namestr[DNS_NAME_FORMATSIZE]; @@ -1807,17 +1787,38 @@ recvsoa(isc_task_t *task, isc_event_t *event) { get_address(serverstr, DNSDEFAULTPORT, &tempaddr); serveraddr = &tempaddr; } + dns_rdata_freestruct(&soa); send_update(zonename, serveraddr, localaddr); + setzoneclass(dns_rdataclass_none); dns_message_destroy(&soaquery); dns_request_destroy(&request); out: - setzoneclass(dns_rdataclass_none); - dns_rdata_freestruct(&soa); dns_message_destroy(&rcvmsg); ddebug("Out of recvsoa"); + return; + + droplabel: + result = dns_message_firstname(soaquery, DNS_SECTION_QUESTION); + INSIST(result == ISC_R_SUCCESS); + name = NULL; + dns_message_currentname(soaquery, DNS_SECTION_QUESTION, &name); + nlabels = dns_name_countlabels(name); + if (nlabels == 1) + fatal("could not find enclosing zone"); + dns_name_init(&tname, NULL); + dns_name_getlabelsequence(name, 1, nlabels - 1, &tname); + dns_name_clone(&tname, name); + dns_request_destroy(&request); + dns_message_renderreset(soaquery); + if (userserver != NULL) + sendrequest(localaddr, userserver, soaquery, &request); + else + sendrequest(localaddr, &servers[ns_inuse], soaquery, + &request); + goto out; } static void diff --git a/contrib/bind9/bin/rndc/rndc-confgen.c b/contrib/bind9/bin/rndc/rndc-confgen.c index ef0d497..f6e578e 100644 --- a/contrib/bind9/bin/rndc/rndc-confgen.c +++ b/contrib/bind9/bin/rndc/rndc-confgen.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc-confgen.c,v 1.9.2.6.2.4 2004/03/06 10:21:31 marka Exp $ */ +/* $Id: rndc-confgen.c,v 1.9.2.6.2.5 2004/09/28 07:14:57 marka Exp $ */ #include <config.h> @@ -273,7 +273,8 @@ main(int argc, char **argv) { buf = isc_mem_get(mctx, len); if (buf == NULL) fatal("isc_mem_get(%d) failed\n", len); - snprintf(buf, len, "%s/%s", chrootdir, keyfile); + snprintf(buf, len, "%s%s%s", chrootdir, + (*keyfile != '/') ? "/" : "", keyfile); write_key_file(buf, user, keyname, &key_txtbuffer); isc_mem_put(mctx, buf, len); diff --git a/contrib/bind9/bin/rndc/rndc.c b/contrib/bind9/bin/rndc/rndc.c index 89ca1df..c74828c 100644 --- a/contrib/bind9/bin/rndc/rndc.c +++ b/contrib/bind9/bin/rndc/rndc.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc.c,v 1.77.2.5.2.12.6.1 2004/09/20 01:00:01 marka Exp $ */ +/* $Id: rndc.c,v 1.77.2.5.2.13 2004/09/03 03:43:32 marka Exp $ */ /* * Principal Author: DCL |