From 67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 20 Dec 2011 00:06:54 +0000 Subject: [PATCH] 3249. [bug] Update log message when saving slave zones files for analysis after load failures. [RT #27087] 3248. [bug] Configure options --enable-fixed-rrset and --enable-exportlib were incompatible with each other. [RT #27087] 3247. [bug] 'raw' format zones failed to preserve load order breaking 'fixed' sort order. [RT #27087] 3246. [bug] Named failed to start with a empty also-notify list. [RT #27087] --- CHANGES | 13 +++++++++++++ bin/named/zoneconf.c | 16 +++++++++++----- bin/tests/system/notify/ns2/named.conf | 4 +++- lib/dns/ecdb.c | 18 +++++++++++++----- lib/dns/masterdump.c | 3 ++- lib/dns/zone.c | 7 ++++--- 6 files changed, 46 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 5731cb6d07..5d678146cf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,16 @@ +3249. [bug] Update log message when saving slave zones files for + analysis after load failures. [RT #27087] + +3248. [bug] Configure options --enable-fixed-rrset and + --enable-exportlib were incompatible with each + other. [RT #27087] + +3247. [bug] 'raw' format zones failed to preserve load order + breaking 'fixed' sort order. [RT #27087] + +3246. [bug] Named failed to start with a empty also-notify list. + [RT #27087] + 3245. [bug] Don't report a error unchanged serials unless there were other changes when thawing a zone with ixfr-fromdifferences. [RT #26845] diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index 68387d8cec..4d6a2ce2e9 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.185 2011/10/26 15:23:36 each Exp $ */ +/* $Id: zoneconf.c,v 1.186 2011/12/20 00:06:54 marka Exp $ */ /*% */ @@ -1045,8 +1045,11 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, result = dns_zone_setalsonotifywithkeys(zone, addrs, keynames, addrcount); - ns_config_putipandkeylist(mctx, &addrs, &keynames, - addrcount); + if (addrcount != 0) + ns_config_putipandkeylist(mctx, &addrs, + &keynames, addrcount); + else + INSIST(addrs == NULL && keynames == NULL); RETERR(result); } else RETERR(dns_zone_setalsonotify(zone, NULL, 0)); @@ -1458,8 +1461,11 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, &count)); result = dns_zone_setmasterswithkeys(mayberaw, addrs, keynames, count); - ns_config_putipandkeylist(mctx, &addrs, &keynames, - count); + if (count != 0) + ns_config_putipandkeylist(mctx, &addrs, + &keynames, count); + else + INSIST(addrs == NULL && keynames == NULL); } else result = dns_zone_setmasters(mayberaw, NULL, 0); RETERR(result); diff --git a/bin/tests/system/notify/ns2/named.conf b/bin/tests/system/notify/ns2/named.conf index d77696806e..139114639e 100644 --- a/bin/tests/system/notify/ns2/named.conf +++ b/bin/tests/system/notify/ns2/named.conf @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named.conf,v 1.22 2011/10/17 23:46:33 tbox Exp $ */ +/* $Id: named.conf,v 1.23 2011/12/20 00:06:54 marka Exp $ */ controls { /* empty */ }; @@ -39,4 +39,6 @@ zone "." { zone "example" { type master; file "example.db"; + // Check that named can handle a empty also-notify. + also-notify { /* empty */ }; }; diff --git a/lib/dns/ecdb.c b/lib/dns/ecdb.c index d71c4503b2..fa08f0860c 100644 --- a/lib/dns/ecdb.c +++ b/lib/dns/ecdb.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ecdb.c,v 1.9 2011/10/11 13:33:45 marka Exp $ */ +/* $Id: ecdb.c,v 1.10 2011/12/20 00:06:53 marka Exp $ */ #include "config.h" @@ -37,10 +37,6 @@ #define ECDBNODE_MAGIC ISC_MAGIC('E', 'C', 'D', 'N') #define VALID_ECDBNODE(ecdbn) ISC_MAGIC_VALID(ecdbn, ECDBNODE_MAGIC) -#if DNS_RDATASET_FIXED -#error "Fixed rdataset isn't supported in this implementation" -#endif - /*% * The 'ephemeral' cache DB (ecdb) implementation. An ecdb just provides * temporary storage for ongoing name resolution with the common DB interfaces. @@ -662,7 +658,11 @@ rdataset_first(dns_rdataset_t *rdataset) { rdataset->private5 = NULL; return (ISC_R_NOMORE); } +#if DNS_RDATASET_FIXED + raw += 2 + (4 * count); +#else raw += 2; +#endif /* * The privateuint4 field is the number of rdata beyond the cursor * position, so we decrement the total count by one before storing @@ -688,7 +688,11 @@ rdataset_next(dns_rdataset_t *rdataset) { rdataset->privateuint4 = count; raw = rdataset->private5; length = raw[0] * 256 + raw[1]; +#if DNS_RDATASET_FIXED + raw += length + 4; +#else raw += length + 2; +#endif rdataset->private5 = raw; return (ISC_R_SUCCESS); @@ -704,7 +708,11 @@ rdataset_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata) { REQUIRE(raw != NULL); length = raw[0] * 256 + raw[1]; +#if DNS_RDATASET_FIXED + raw += 4; +#else raw += 2; +#endif if (rdataset->type == dns_rdatatype_rrsig) { if (*raw & DNS_RDATASLAB_OFFLINE) flags |= DNS_RDATA_OFFLINE; diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index c3f6dd6e2a..9bda235f68 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.112 2011/12/08 23:46:48 tbox Exp $ */ +/* $Id: masterdump.c,v 1.113 2011/12/20 00:06:53 marka Exp $ */ /*! \file */ @@ -932,6 +932,7 @@ dump_rdataset_raw(isc_mem_t *mctx, dns_name_t *name, dns_rdataset_t *rdataset, REQUIRE(buffer->length > 0); REQUIRE(DNS_RDATASET_VALID(rdataset)); + rdataset->attributes |= DNS_RDATASETATTR_LOADORDER; restart: totallen = 0; result = dns_rdataset_first(rdataset); diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 124aecd837..f20c758ff9 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.655 2011/12/19 23:46:12 marka Exp $ */ +/* $Id: zone.c,v 1.656 2011/12/20 00:06:53 marka Exp $ */ /*! \file */ @@ -14049,8 +14049,9 @@ zone_saveunique(dns_zone_t *zone, const char *path, const char *templat) { if (result != ISC_R_SUCCESS) goto cleanup; - dns_zone_log(zone, ISC_LOG_WARNING, "saved '%s' as '%s'", - path, buf); + dns_zone_log(zone, ISC_LOG_WARNING, "unable to load from '%'; " + "renaming file to '%s' for failure analysis and " + "retransferring.", path, buf); cleanup: isc_mem_put(zone->mctx, buf, buflen);