From 6f808593181c16d5a7625cb527a5755872f9680c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 4 Nov 2003 05:23:31 +0000 Subject: [PATCH] 1530. [bug] It was possible to trigger a INSIST() failure if a slave master file was removed a just the correct moment. [RT #9462] --- CHANGES | 4 ++++ lib/dns/zone.c | 51 +++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index c2832e2f60..6346424b3d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1530. [bug] It was possible to trigger a INSIST() failure if a + slave master file was removed a just the correct + moment. [RT #9462] + 1529. [bug] "notify explict;" failed to log that NOTIFY messages were being sent for the zone. diff --git a/lib/dns/zone.c b/lib/dns/zone.c index f892ad8afd..fb8b889255 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.401 2003/11/03 23:40:24 marka Exp $ */ +/* $Id: zone.c,v 1.402 2003/11/04 05:23:31 marka Exp $ */ #include @@ -5275,30 +5275,6 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) { */ if (zone->db == NULL) goto same_master; - /* - * This is not neccessary if we just performed a AXFR - * however it is necessary for an IXFR / UPTODATE and - * won't hurt with an AXFR. - */ - if (zone->masterfile != NULL || zone->journal != NULL) { - result = ISC_R_FAILURE; - if (zone->journal != NULL) - result = isc_file_settime(zone->journal, &now); - if (result != ISC_R_SUCCESS && - zone->masterfile != NULL) - result = isc_file_settime(zone->masterfile, - &now); - /* Someone removed the file from underneath us! */ - if (result == ISC_R_FILENOTFOUND && - zone->masterfile != NULL) - zone_needdump(zone, DNS_DUMP_DELAY); - else if (result != ISC_R_SUCCESS) - dns_zone_log(zone, ISC_LOG_ERROR, - "transfer: could not set file " - "modification time of '%s': %s", - zone->masterfile, - dns_result_totext(result)); - } /* * Update the zone structure's data from the actual @@ -5361,6 +5337,31 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) { zone->serial, buf); } + /* + * This is not neccessary if we just performed a AXFR + * however it is necessary for an IXFR / UPTODATE and + * won't hurt with an AXFR. + */ + if (zone->masterfile != NULL || zone->journal != NULL) { + result = ISC_R_FAILURE; + if (zone->journal != NULL) + result = isc_file_settime(zone->journal, &now); + if (result != ISC_R_SUCCESS && + zone->masterfile != NULL) + result = isc_file_settime(zone->masterfile, + &now); + /* Someone removed the file from underneath us! */ + if (result == ISC_R_FILENOTFOUND && + zone->masterfile != NULL) + zone_needdump(zone, DNS_DUMP_DELAY); + else if (result != ISC_R_SUCCESS) + dns_zone_log(zone, ISC_LOG_ERROR, + "transfer: could not set file " + "modification time of '%s': %s", + zone->masterfile, + dns_result_totext(result)); + } + break; case DNS_R_BADIXFR: