mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
2878. [func] Incrementally write the master file after performing
a AXFR. [RT #21010]
This commit is contained in:
parent
0932d830f0
commit
1df2b7edfe
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
|||||||
|
2878. [func] Incrementally write the master file after performing
|
||||||
|
a AXFR. [RT #21010]
|
||||||
|
|
||||||
2877. [bug] The validator failed to skip obviously mismatching
|
2877. [bug] The validator failed to skip obviously mismatching
|
||||||
RRSIGs. [RT #21138]
|
RRSIGs. [RT #21138]
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: zone.c,v 1.558 2010/02/26 01:39:49 marka Exp $ */
|
/* $Id: zone.c,v 1.559 2010/04/27 03:24:52 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@ -366,6 +366,7 @@ struct dns_zone {
|
|||||||
#define DNS_ZONEFLG_REFRESHING 0x04000000U /*%< Refreshing keydata */
|
#define DNS_ZONEFLG_REFRESHING 0x04000000U /*%< Refreshing keydata */
|
||||||
#define DNS_ZONEFLG_THAW 0x08000000U
|
#define DNS_ZONEFLG_THAW 0x08000000U
|
||||||
#define DNS_ZONEFLG_NOTIFYRESIGN 0x10000000U
|
#define DNS_ZONEFLG_NOTIFYRESIGN 0x10000000U
|
||||||
|
#define DNS_ZONEFLG_NODELAY 0x20000000U
|
||||||
|
|
||||||
#define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
|
#define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
|
||||||
#define DNS_ZONEKEY_OPTION(z,o) (((z)->keyopts & (o)) != 0)
|
#define DNS_ZONEKEY_OPTION(z,o) (((z)->keyopts & (o)) != 0)
|
||||||
@ -11444,24 +11445,24 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (dump && zone->masterfile != NULL) {
|
if (dump && zone->masterfile != NULL) {
|
||||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NODELAY);
|
||||||
DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3),
|
|
||||||
"dumping new zone version");
|
|
||||||
result = dns_db_dump2(db, ver, zone->masterfile,
|
|
||||||
zone->masterformat);
|
|
||||||
if (result != ISC_R_SUCCESS)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update the time the zone was updated, so
|
* If DNS_ZONEFLG_FORCEXFER was set we don't want
|
||||||
* dns_zone_load can avoid loading it when
|
* to keep the old masterfile.
|
||||||
* the server is reloaded. If isc_time_now
|
|
||||||
* fails for some reason, all that happens is
|
|
||||||
* the timestamp is not updated.
|
|
||||||
*/
|
*/
|
||||||
TIME_NOW(&zone->loadtime);
|
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCEXFER) &&
|
||||||
|
remove(zone->masterfile) < 0 && errno != ENOENT) {
|
||||||
|
char strbuf[ISC_STRERRORSIZE];
|
||||||
|
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||||
|
isc_log_write(dns_lctx,
|
||||||
|
DNS_LOGCATEGORY_GENERAL,
|
||||||
|
DNS_LOGMODULE_ZONE,
|
||||||
|
ISC_LOG_WARNING,
|
||||||
|
"unable to remove masterfile "
|
||||||
|
"'%s': '%s'",
|
||||||
|
zone->masterfile, strbuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dump && zone->journal != NULL) {
|
if (dump && zone->journal != NULL) {
|
||||||
/*
|
/*
|
||||||
* The in-memory database just changed, and
|
* The in-memory database just changed, and
|
||||||
@ -11657,16 +11658,19 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
|
|||||||
&now);
|
&now);
|
||||||
/* Someone removed the file from underneath us! */
|
/* Someone removed the file from underneath us! */
|
||||||
if (result == ISC_R_FILENOTFOUND &&
|
if (result == ISC_R_FILENOTFOUND &&
|
||||||
zone->masterfile != NULL)
|
zone->masterfile != NULL) {
|
||||||
zone_needdump(zone, DNS_DUMP_DELAY);
|
unsigned int delay = DNS_DUMP_DELAY;
|
||||||
else if (result != ISC_R_SUCCESS)
|
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NODELAY))
|
||||||
|
delay = 0;
|
||||||
|
zone_needdump(zone, delay);
|
||||||
|
} else if (result != ISC_R_SUCCESS)
|
||||||
dns_zone_log(zone, ISC_LOG_ERROR,
|
dns_zone_log(zone, ISC_LOG_ERROR,
|
||||||
"transfer: could not set file "
|
"transfer: could not set file "
|
||||||
"modification time of '%s': %s",
|
"modification time of '%s': %s",
|
||||||
zone->masterfile,
|
zone->masterfile,
|
||||||
dns_result_totext(result));
|
dns_result_totext(result));
|
||||||
}
|
}
|
||||||
|
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NODELAY);
|
||||||
inc_stats(zone, dns_zonestatscounter_xfrsuccess);
|
inc_stats(zone, dns_zonestatscounter_xfrsuccess);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user