From: Chris Hofstaedtler Date: Wed, 6 Dec 2023 17:23:44 +0000 (+0100) Subject: auth: add test for mixing CNAME with other types on wildcards X-Git-Tag: auth-4.9.0-alpha1~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13635%2Fhead;p=thirdparty%2Fpdns.git auth: add test for mixing CNAME with other types on wildcards --- diff --git a/modules/tinydnsbackend/data b/modules/tinydnsbackend/data index 7a262b3eda..dca063c8af 100644 --- a/modules/tinydnsbackend/data +++ b/modules/tinydnsbackend/data @@ -8,6 +8,7 @@ &italy.example.com::italy-ns2.example.com.:120 &usa.example.com::usa-ns1.usa.example.com.:120 &usa.example.com::usa-ns2.usa.example.com.:120 ++\052.mixed-wc.example.com:192.168.1.1:120 +\052.w5.example.com:1.2.3.5:120 +bar.svcb.example.com:192.0.2.1:120 +double.example.com:192.168.5.1:120 @@ -20141,6 +20142,7 @@ @mail.example.com::smtp1.example.com.:25:120 @together-too-much.example.com::toomuchinfo-a.example.com.:25:120 @together-too-much.example.com::toomuchinfo-b.example.com.:25:120 +C\052.mixed-wc.example.com:outpost.example.com.:120 C\052.w1.example.com:x.y.z.w2.example.com.:120 C\052.w2.example.com:x.y.z.w3.example.com.:120 C\052.w3.example.com:x.y.z.w4.example.com.:120 diff --git a/modules/tinydnsbackend/data.cdb b/modules/tinydnsbackend/data.cdb index b71ae2d51e..ecb1694777 100644 Binary files a/modules/tinydnsbackend/data.cdb and b/modules/tinydnsbackend/data.cdb differ diff --git a/regression-tests.nobackend/tinydns-data-check/expected_result b/regression-tests.nobackend/tinydns-data-check/expected_result index 71c0ebda7a..29e484430f 100644 --- a/regression-tests.nobackend/tinydns-data-check/expected_result +++ b/regression-tests.nobackend/tinydns-data-check/expected_result @@ -1,4 +1,4 @@ -229dad9ea0464a429685d3dda8a8e9ef ../regression-tests/zones/example.com +2ed2eb54a4cb3fd105aa78e6d4c99685 ../regression-tests/zones/example.com f8f0d7b157495ec8ee70851e3d5cb65e ../regression-tests/zones/test.com e5e3ee998d151fe194b98997eaa36c53 ../regression-tests/zones/test.dyndns dee3e8b568549d9450134b555ca73990 ../regression-tests/zones/sub.test.dyndns @@ -15,5 +15,5 @@ a98864b315f16bcf49ce577426063c42 ../regression-tests/zones/cdnskey-cds-test.com 9aeed2c26d0c3ba3baf22dfa9568c451 ../regression-tests/zones/2.0.192.in-addr.arpa 99c73e8b5db5781fec1ac3fa6a2662a9 ../regression-tests/zones/cryptokeys.org 1f9e19be0cff67330f3a0a5347654f91 ../regression-tests/zones/hiddencryptokeys.org -964425367cec0d828222b144c4e1c540 ../modules/tinydnsbackend/data -f3932b1df41d683f47516455b571c358 ../modules/tinydnsbackend/data.cdb +e85d67cb577cf1de3127e439e7529311 ../modules/tinydnsbackend/data +7715e725358f969aa92e46ae9be0c464 ../modules/tinydnsbackend/data.cdb diff --git a/regression-tests/tests/cname-and-wildcard-trump/command b/regression-tests/tests/cname-and-wildcard-trump/command new file mode 100755 index 0000000000..81371ad1c8 --- /dev/null +++ b/regression-tests/tests/cname-and-wildcard-trump/command @@ -0,0 +1,2 @@ +#!/bin/sh +cleandig test.mixed-wc.example.com A diff --git a/regression-tests/tests/cname-and-wildcard-trump/description b/regression-tests/tests/cname-and-wildcard-trump/description new file mode 100644 index 0000000000..4388603a25 --- /dev/null +++ b/regression-tests/tests/cname-and-wildcard-trump/description @@ -0,0 +1,2 @@ +If a CNAME and another type exist on a wildcard (ignoring RFC requirements), +only the CNAME shall be returned, ignoring the other type. diff --git a/regression-tests/tests/cname-and-wildcard-trump/expected_result b/regression-tests/tests/cname-and-wildcard-trump/expected_result new file mode 100644 index 0000000000..ef95f7d257 --- /dev/null +++ b/regression-tests/tests/cname-and-wildcard-trump/expected_result @@ -0,0 +1,4 @@ +0 outpost.example.com. 120 IN A 192.168.2.1 +0 test.mixed-wc.example.com. 120 IN CNAME outpost.example.com. +Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='test.mixed-wc.example.com.', qtype=A diff --git a/regression-tests/tests/cname-and-wildcard-trump/skip-unboundhost b/regression-tests/tests/cname-and-wildcard-trump/skip-unboundhost new file mode 100644 index 0000000000..e69de29bb2 diff --git a/regression-tests/zones/example.com b/regression-tests/zones/example.com index f2decf231d..cd5657a853 100644 --- a/regression-tests/zones/example.com +++ b/regression-tests/zones/example.com @@ -81,6 +81,10 @@ italy IN NS italy-ns2 italy-ns1 IN A 192.168.5.1 italy-ns2 IN A 192.168.5.2 ; +; CNAME on wildcard mixed with another type +*.mixed-wc IN A 192.168.1.1 +*.mixed-wc IN CNAME outpost +; mail IN MX 25 smtp1 smtp1 IN CNAME outpost ;