Commit 9e465a8dbc for bind
commit 9e465a8dbccba974d233800ae15e1c4195cc3a37
Author: Colin Vidal <colin@isc.org>
Date: Fri Sep 11 10:28:25 2026 +0200
Test RPZ NSDNAME with parent and child zone on one server
Forward port of test for issue #6407.
diff --git a/bin/tests/system/rpz/ns11/0.0.127.in-addr.arpa.db b/bin/tests/system/rpz/ns11/0.0.127.in-addr.arpa.db
new file mode 100644
index 0000000000..7d5ae080f4
--- /dev/null
+++ b/bin/tests/system/rpz/ns11/0.0.127.in-addr.arpa.db
@@ -0,0 +1,3 @@
+0.0.127.in-addr.arpa. 60 IN SOA localhost. localhost.localdomain. 1 60 60 60 60
+ 60 IN NS .
+1 60 IN PTR localhost.
diff --git a/bin/tests/system/rpz/ns11/named.conf.j2 b/bin/tests/system/rpz/ns11/named.conf.j2
new file mode 100644
index 0000000000..beb4ba2b2d
--- /dev/null
+++ b/bin/tests/system/rpz/ns11/named.conf.j2
@@ -0,0 +1,29 @@
+options {
+ {% include_indented "_common/options.conf.j2" %}
+ dnssec-validation no;
+ response-policy {
+ zone "nsdname.";
+ };
+
+ /*
+ * This is the default, but this config covers a crash fix
+ * where a parent zone and a child zone are on the same auth.
+ * Here, 127.IN-ADDR.ARPA (parent of the "0.0.127.in-addr.arpa" below)
+ * is implicitly created.
+ */
+ empty-zones-enable yes;
+};
+
+{% include "_common/controls.conf.j2" %}
+
+{% include "_common/root.hint.conf" %}
+
+zone "0.0.127.in-addr.arpa" {
+ type primary;
+ file "0.0.127.in-addr.arpa.db";
+};
+
+zone "nsdname." {
+ type primary;
+ file "nsdname.db";
+};
diff --git a/bin/tests/system/rpz/ns11/nsdname.db b/bin/tests/system/rpz/ns11/nsdname.db
new file mode 100644
index 0000000000..c1638a466c
--- /dev/null
+++ b/bin/tests/system/rpz/ns11/nsdname.db
@@ -0,0 +1,6 @@
+nsdname. 60 IN SOA localhost. localhost.localdomain. 1 60 60 60 60
+ 60 IN NS .
+$ORIGIN nsdname.
+ns.0xc0f1c3a5.com.rpz-nsdname 60 IN CNAME *.walled-garden.example.com.
+ns.0xc0f1c3a5.net.rpz-nsdname 60 IN CNAME *.walled-garden.example.com.
+ns.0xc0f1c3a5.org.rpz-nsdname 60 IN CNAME *.walled-garden.example.com.
diff --git a/bin/tests/system/rpz/tests_rpz_6407.py b/bin/tests/system/rpz/tests_rpz_6407.py
new file mode 100644
index 0000000000..8ba77ebec8
--- /dev/null
+++ b/bin/tests/system/rpz/tests_rpz_6407.py
@@ -0,0 +1,20 @@
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+import isctest
+
+
+# This tests ensures the server does not crash during this query.
+# See issue B#6407
+def test_rpz_6407(ns11):
+ msg = isctest.query.create("1.0.0.127.in-addr.arpa.", "PTR")
+ res = isctest.query.tcp(msg, ns11.ip)
+ isctest.check.noerror(res)