mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 19:50:00 -04:00
fix: usr: Fix a possible catalog zone issue during reconfiguration
The :iscman:`named` process could terminate unexpectedly during reconfiguration when a catalog zone update was taking place at the same time. This has been fixed. Merge branch 'aram/catz-reconfig-crash-fix' into 'main' See merge request isc-projects/bind9!11366
This commit is contained in:
commit
9e806bd81f
3 changed files with 39 additions and 5 deletions
|
|
@ -2716,6 +2716,15 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
|
|||
}
|
||||
|
||||
result = dns_catz_zone_add(view->catzs, &origin, &zone);
|
||||
if (result != ISC_R_SUCCESS && result != ISC_R_EXISTS) {
|
||||
cfg_obj_log(catz_obj, DNS_CATZ_ERROR_LEVEL,
|
||||
"catz: dns_catz_zone_add failed: %s",
|
||||
isc_result_totext(result));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dns_catz_zone_prereconfig(zone);
|
||||
|
||||
if (result == ISC_R_EXISTS) {
|
||||
catz_reconfig_data_t data = {
|
||||
.catz = zone,
|
||||
|
|
@ -2734,11 +2743,6 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
|
|||
&data);
|
||||
|
||||
result = ISC_R_SUCCESS;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(catz_obj, DNS_CATZ_ERROR_LEVEL,
|
||||
"catz: dns_catz_zone_add failed: %s",
|
||||
isc_result_totext(result));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dns_catz_zone_resetdefoptions(zone);
|
||||
|
|
@ -2776,6 +2780,8 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
|
|||
opts->min_update_interval = cfg_obj_asduration(obj);
|
||||
}
|
||||
|
||||
dns_catz_zone_postreconfig(zone);
|
||||
|
||||
cleanup:
|
||||
dns_name_free(&origin, view->mctx);
|
||||
if (ipkl.count != 0) {
|
||||
|
|
|
|||
|
|
@ -2525,6 +2525,16 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) {
|
|||
isc_ht_iter_destroy(&iter);
|
||||
}
|
||||
|
||||
void
|
||||
dns_catz_zone_prereconfig(dns_catz_zone_t *catz) {
|
||||
LOCK(&catz->lock);
|
||||
}
|
||||
|
||||
void
|
||||
dns_catz_zone_postreconfig(dns_catz_zone_t *catz) {
|
||||
UNLOCK(&catz->lock);
|
||||
}
|
||||
|
||||
void
|
||||
dns_catz_zone_for_each_entry2(dns_catz_zone_t *catz, dns_catz_entry_cb2 cb,
|
||||
void *arg1, void *arg2) {
|
||||
|
|
|
|||
|
|
@ -403,6 +403,24 @@ dns_catz_zones_shutdown(dns_catz_zones_t *catzs);
|
|||
typedef void (*dns_catz_entry_cb2)(dns_catz_entry_t *entry, void *arg1,
|
||||
void *arg2);
|
||||
|
||||
void
|
||||
dns_catz_zone_prereconfig(dns_catz_zone_t *catz);
|
||||
/*%<
|
||||
* Must be called before reconfiguring a catalog zone. Locks the catalog zone.
|
||||
*
|
||||
* Requires:
|
||||
* \li 'catz' is a valid, unlocked dns_catz_zone_t.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_catz_zone_postreconfig(dns_catz_zone_t *catz);
|
||||
/*%<
|
||||
* Must be called after reconfiguring a catalog zone. Unlocks the catalog zone.
|
||||
*
|
||||
* Requires:
|
||||
* \li 'catz' is a valid, locked dns_catz_zone_t.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_catz_zone_for_each_entry2(dns_catz_zone_t *catz, dns_catz_entry_cb2 cb,
|
||||
void *arg1, void *arg2);
|
||||
|
|
|
|||
Loading…
Reference in a new issue