summaryrefslogtreecommitdiffstats
path: root/debian/patches/0031-Unload-a-zone-if-a-transfer-breaks-its-SOA-record.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 18:37:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 18:37:15 +0000
commit55ad72d44a94298a96b8f05488ca5ed97ef04736 (patch)
tree8aaa712c1d8b8d191b77a7eef4dc42c770e3b3d0 /debian/patches/0031-Unload-a-zone-if-a-transfer-breaks-its-SOA-record.patch
parentAdding upstream version 1:9.11.5.P4+dfsg. (diff)
downloadbind9-55ad72d44a94298a96b8f05488ca5ed97ef04736.tar.xz
bind9-55ad72d44a94298a96b8f05488ca5ed97ef04736.zip
Adding debian version 1:9.11.5.P4+dfsg-5.1+deb10u7.debian/1%9.11.5.P4+dfsg-5.1+deb10u7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/0031-Unload-a-zone-if-a-transfer-breaks-its-SOA-record.patch')
-rw-r--r--debian/patches/0031-Unload-a-zone-if-a-transfer-breaks-its-SOA-record.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/debian/patches/0031-Unload-a-zone-if-a-transfer-breaks-its-SOA-record.patch b/debian/patches/0031-Unload-a-zone-if-a-transfer-breaks-its-SOA-record.patch
new file mode 100644
index 0000000..93c75ec
--- /dev/null
+++ b/debian/patches/0031-Unload-a-zone-if-a-transfer-breaks-its-SOA-record.patch
@@ -0,0 +1,40 @@
+From: Mark Andrews <marka@isc.org>
+Date: Thu, 25 Feb 2021 14:11:05 +1100
+Subject: Unload a zone if a transfer breaks its SOA record
+
+If a zone transfer results in a zone not having any NS records, named
+stops serving it because such a zone is broken. Do the same if an
+incoming zone transfer results in a zone lacking an SOA record at the
+apex or containing more than one SOA record.
+---
+ lib/dns/zone.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/lib/dns/zone.c b/lib/dns/zone.c
+index 6d4426a..c3c8f94 100644
+--- a/lib/dns/zone.c
++++ b/lib/dns/zone.c
+@@ -15352,11 +15352,20 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
+ &retry, &expire, &minimum, NULL);
+ ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ if (result == ISC_R_SUCCESS) {
+- if (soacount != 1)
++ if (soacount != 1) {
+ dns_zone_log(zone, ISC_LOG_ERROR,
+ "transferred zone "
+- "has %d SOA record%s", soacount,
+- (soacount != 0) ? "s" : "");
++ "has %d SOA records",
++ soacount);
++ if (DNS_ZONE_FLAG(zone,
++ DNS_ZONEFLG_HAVETIMERS)) {
++ zone->refresh = DNS_ZONE_DEFAULTREFRESH;
++ zone->retry = DNS_ZONE_DEFAULTRETRY;
++ }
++ DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_HAVETIMERS);
++ zone_unload(zone);
++ goto next_master;
++ }
+ if (nscount == 0) {
+ dns_zone_log(zone, ISC_LOG_ERROR,
+ "transferred zone "