40261a
From 7b4c1e28b3e64f7cd075599472e349510f8d33da Mon Sep 17 00:00:00 2001
40261a
From: Petr Menšík <pemensik@redhat.com>
40261a
Date: Sep 14 2022 15:23:20 +0000
40261a
Subject: Modify empty zone conflicts under exclusive mode
40261a
40261a
40261a
Does not accept new request when exclusive mode is active. Zone table
40261a
can be modified even after main fwd entries have been added. Ensure
40261a
empty zones handling keeps exclusive mode active.
40261a
40261a
Exclusive mode were mentioned as the only protection it had by bind
40261a
maintainer:
40261a
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/6637#note_308928
40261a
40261a
---
40261a
40261a
diff --git a/src/fwd.c b/src/fwd.c
40261a
index 24f6e53..0a3c673 100644
40261a
--- a/src/fwd.c
40261a
+++ b/src/fwd.c
40261a
@@ -595,10 +595,12 @@ fwd_configure_zone(const settings_set_t *set, ldap_instance_t *inst,
40261a
 		  dns_result_totext(result));
40261a
 
40261a
 	/* Handle collisions with automatic empty zones. */
40261a
-	if (isconfigured == true)
40261a
+	if (isconfigured == true) {
40261a
+		run_exclusive_enter(inst, &lock_state);
40261a
 		CHECK(empty_zone_handle_conflicts(name,
40261a
 						  view->zonetable,
40261a
 						  (fwdpolicy == dns_fwdpolicy_first)));
40261a
+	}
40261a
 
40261a
 cleanup:
40261a
 	run_exclusive_exit(inst, lock_state);
40261a