]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3925. [bug] DS lookup of RFC 1918 empty zones failed. [RT #36917
authorMark Andrews <marka@isc.org>
Fri, 22 Aug 2014 06:32:19 +0000 (16:32 +1000)
committerMark Andrews <marka@isc.org>
Fri, 22 Aug 2014 06:33:06 +0000 (16:33 +1000)
(cherry picked from commit 840d6a4614f6a561fc076d0797d144e9f28e06bc)

CHANGES
bin/tests/system/dnssec/clean.sh
bin/tests/system/dnssec/ns1/root.db.in
bin/tests/system/dnssec/ns1/sign.sh
bin/tests/system/dnssec/ns2/in-addr.arpa.db.in [new file with mode: 0644]
bin/tests/system/dnssec/ns2/named.conf
bin/tests/system/dnssec/ns2/sign.sh
bin/tests/system/dnssec/tests.sh
lib/dns/view.c

diff --git a/CHANGES b/CHANGES
index eafd3dc84806bbcd71ba8b9953e96f647b5688dd..d89edd6286897a66df05a6e99e9e99603527dacd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3925.  [bug]           DS lookup of RFC 1918 empty zones failed. [RT #36917]
+
 3924.  [bug]           Improve 'rndc addzone' error reporting. [RT #35187]
 
 3923.  [bug]           Sanity check the xml2-config output. [RT #22246]
index e4c927dc3a42f257149a31e25f4e3082e8e749c9..e197f9ed8526a7a6a9d126bd871fa1dd03d11bb1 100644 (file)
@@ -27,6 +27,7 @@ rm -f ns2/private.secure.example.db
 rm -f ns2/badparam.db ns2/badparam.db.bad
 rm -f ns2/single-nsec3.db
 rm -f ns2/nsec3chain-test.db
+rm -f ns2/in-addr.arpa.db
 rm -f */example.bk
 rm -f dig.out.*
 rm -f rndc.out.*
index a00b69f409fab620caa93ce1a3a9b23b0fda2723..6efbef1674224cf9a1da3e23f7683d4db0141380 100644 (file)
@@ -34,3 +34,4 @@ algroll                       NS      ns2.algroll
 ns2.algroll.           A       10.53.0.2
 optout-tld             NS      ns6.optout-tld.
 ns6.optout-tld.                A       10.53.0.6
+in-addr.arpa.          NS      ns2.example.
index 88e6e87181090cf3ed54dea259dbb4374b7ba5c2..8e9005b803ff173bbb0547906607d611c06fd8a6 100644 (file)
@@ -28,6 +28,8 @@ zonefile=root.db
 
 cp ../ns2/dsset-example. .
 cp ../ns2/dsset-dlv. .
+cp ../ns2/dsset-in-addr.arpa. .
+
 grep "8 [12] " ../ns2/dsset-algroll. > dsset-algroll.
 cp ../ns6/dsset-optout-tld. .
 
diff --git a/bin/tests/system/dnssec/ns2/in-addr.arpa.db.in b/bin/tests/system/dnssec/ns2/in-addr.arpa.db.in
new file mode 100644 (file)
index 0000000..d60b717
--- /dev/null
@@ -0,0 +1,8 @@
+$TTL 3600
+@      SOA     ns2.example. . 1 3600 1200 86400 1200
+@      NS      ns2.example.
+;
+;      As we are testing empty zone behaviour ns3 doesn't need to be
+;      configured to serve 10.in-addr.arpa.
+;
+10     NS      ns3.example.
index 40a71503af690874ff23e99c6e1d24b2f3d56689..a6f9aafca425433a9872279599891cfbb70324ef 100644 (file)
@@ -102,4 +102,9 @@ zone "nsec3chain-test" {
        allow-update {any;};
 };
 
+zone "in-addr.arpa" {
+       type master;
+       file "in-addr.arpa.db.signed";
+};
+
 include "trusted.conf";
index a4dcad3788f462f84a3c7c67bb17e08b025a11e3..ede940dce8e33da3671ec7fb31c226f5a2f59934 100644 (file)
@@ -88,6 +88,18 @@ tolower($1) == "bad-dname.example." && $4 == "RRSIG" && $5 == "DNAME" {
 
 { print; }' > $zonefile.signed++ && mv $zonefile.signed++ $zonefile.signed
 
+#
+# signed in-addr.arpa w/ a delegation for 10.in-addr.arpa which is unsigned.
+#
+zone=in-addr.arpa.
+infile=in-addr.arpa.db.in
+zonefile=in-addr.arpa.db
+
+keyname1=`$KEYGEN -q -r $RANDFILE -a DSA -b 768 -n zone $zone`
+keyname2=`$KEYGEN -q -r $RANDFILE -a DSA -b 768 -n zone $zone`
+
+cat $infile $keyname1.key $keyname2.key >$zonefile
+$SIGNER -P -g -r $RANDFILE -o $zone -k $keyname1 $zonefile $keyname2 > /dev/null
 
 # Sign the privately secure file
 
index 6faaa5de443122127070e05407da7262fd29d245..1ce30187cff0baa7581a221a767d69f4df2657cc 100644 (file)
@@ -1727,6 +1727,16 @@ n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:checking that DS at a RFC 1918 empty zone lookup succeeds ($n)"
+ret=0
+$DIG $DIGOPTS +noauth 10.in-addr.arpa ds @10.53.0.2 >dig.out.ns2.test$n || ret=1
+$DIG $DIGOPTS +noauth 10.in-addr.arpa ds @10.53.0.6 >dig.out.ns6.test$n || ret=1
+$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns6.test$n || ret=1
+grep "status: NOERROR" dig.out.ns6.test$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:checking expired signatures remain with "'"allow-update { none; };"'" and no keys available ($n)"
 ret=0
 $DIG $DIGOPTS +noauth expired.example. +dnssec @10.53.0.3 soa > dig.out.ns3.test$n || ret=1
index 5569c8db19e10b9b072746f8912b7e9c5790d150..f86d1c70e49c27d2622bbfe7c82a59e09df8056e 100644 (file)
@@ -1201,6 +1201,7 @@ dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
        dns_name_t *zfname;
        dns_rdataset_t zrdataset, zsigrdataset;
        dns_fixedname_t zfixedname;
+       unsigned int ztoptions = 0;
 
        REQUIRE(DNS_VIEW_VALID(view));
        REQUIRE(view->frozen);
@@ -1222,9 +1223,12 @@ dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
         */
        zone = NULL;
        LOCK(&view->lock);
-       if (view->zonetable != NULL)
-               result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
-       else
+       if (view->zonetable != NULL) {
+               if ((options & DNS_DBFIND_NOEXACT) != 0)
+                       ztoptions |= DNS_ZTFIND_NOEXACT;
+               result = dns_zt_find(view->zonetable, name, ztoptions,
+                                    NULL, &zone);
+       } else
                result = ISC_R_NOTFOUND;
        UNLOCK(&view->lock);
        if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH)