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