]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
A a test to check zone filename case-insensitivity
authorAram Sargsyan <aram@isc.org>
Mon, 13 Apr 2026 11:42:07 +0000 (11:42 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Thu, 16 Apr 2026 11:37:02 +0000 (11:37 +0000)
The test adds a catalog member zone which has '%X' in its name and
it ends up in the zone filename parser's code because the filename
is currently generated (by the catalog zone code) based on the zone's
name.

Zones which have a name with the '%' special character should be
filtered and their name's digest should be used instead for filenane
generation (like it is implemented for other special characters), and
that fix is coming next.

bin/tests/system/catz/tests.sh
bin/tests/system/catz/tests_sh_catz.py

index e90b606d82c1a23a1b425bcdff0d424455545432..46956a8ed94d95eb82a351ad62e803190eceee34 100644 (file)
@@ -2973,6 +2973,58 @@ wait_for_soa @10.53.0.2 dom21.example. dig.out.test$n || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+##########################################################################
+# GL #5849
+
+n=$((n + 1))
+echo_i "Adding a domain token%Xname.example. to primary via RNDC ($n)"
+ret=0
+# enough initial content for IXFR response when TXT record is added below
+echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" >ns1/tokenXname.example.db
+echo "@ 3600 IN NS invalid." >>ns1/tokenXname.example.db
+echo "foo 3600 IN TXT some content here" >>ns1/tokenXname.example.db
+echo "bar 3600 IN TXT some content here" >>ns1/tokenXname.example.db
+echo "xxx 3600 IN TXT some content here" >>ns1/tokenXname.example.db
+echo "yyy 3600 IN TXT some content here" >>ns1/tokenXname.example.db
+rndccmd 10.53.0.1 addzone token%Xname.example. in default '{ type primary; file "tokenXname.example.db"; allow-transfer { any; }; allow-update { any; }; notify explicit; also-notify { 10.53.0.4; }; };' || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+n=$((n + 1))
+echo_i "checking that token%Xname.example. is now served by primary ($n)"
+ret=0
+wait_for_soa @10.53.0.1 token%Xname.example. dig.out.test$n || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+nextpart ns4/named.run >/dev/null
+
+n=$((n + 1))
+echo_i "Adding domain token%Xname.example. to catalog-misc zone ($n)"
+ret=0
+$NSUPDATE -d <<END >>nsupdate.out.test$n 2>&1 || ret=1
+    server 10.53.0.1 ${PORT}
+    update add tokenXname.zones.catalog-misc.example. 3600 IN PTR token%Xname.example.
+    send
+END
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+n=$((n + 1))
+echo_i "waiting for secondary to sync up ($n)"
+ret=0
+wait_for_message ns4/named.run "catz: adding zone 'token%Xname.example' from catalog 'catalog-misc.example'" \
+  && wait_for_message ns4/named.run "transfer of 'token%Xname.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+n=$((n + 1))
+echo_i "checking that token%Xname.example. is served by secondary ($n)"
+ret=0
+wait_for_soa @10.53.0.4 token%Xname.example. dig.out.test$n || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 ##########################################################################
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
index 4b68e2f65e59a61f3547b12ac28173cda41037ab..339a8ed8dc196b67651ee0c06117de88c621232e 100644 (file)
@@ -23,6 +23,7 @@ pytestmark = pytest.mark.extra_artifacts(
         "ns*/*dom*.example.db",
         "ns1/check-allow-query.example.db",
         "ns1/longlong.longlong.long.long.name.example.db",
+        "ns1/tokenXname.example.db",
         "ns1/tls1.example.db",
         "ns2/__catz__*.db",
         "ns2/named.conf.tmp",