]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
caclulate nlabels and set *chainingp correctly
authorEvan Hunt <each@isc.org>
Tue, 24 Jul 2018 17:21:52 +0000 (10:21 -0700)
committerEvan Hunt <each@isc.org>
Tue, 24 Jul 2018 17:23:46 +0000 (10:23 -0700)
(cherry picked from commit e78e55f435e2ee901e609750595f94225cb3e369)

bin/tests/system/resolver/tests.sh
lib/dns/resolver.c

index 73066a881ebe8dd719370feb87f89cbe9178ff41..12d2819e30017f6115453863e08640afad0239ee 100755 (executable)
@@ -204,6 +204,7 @@ n=`expr $n + 1`
 echo_i "checking DNAME target filtering (deny) ($n)"
 ret=0
 $DIG $DIGOPTS +tcp foo.baddname.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
+grep "DNAME target foo.baddname.example.org denied for foo.baddname.example.net/IN" ns1/named.run >/dev/null || ret=1
 grep "status: SERVFAIL" dig.out.ns1.test${n} > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
index b897120e00fcceb8030396f20c0bce7c67fe2023..41d1385f97b90ce41fa01ab3b6e7b1c97bd1aee9 100644 (file)
@@ -6350,13 +6350,14 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname,
                RUNTIME_CHECK(result == ISC_R_SUCCESS);
                dns_name_init(&prefix, NULL);
                tname = dns_fixedname_initname(&fixed);
-               nlabels = dns_name_countlabels(qname) -
-                         dns_name_countlabels(rname);
-               INSIST(nlabels > 0);
+               nlabels = dns_name_countlabels(rname);
                dns_name_split(qname, nlabels, &prefix, NULL);
                result = dns_name_concatenate(&prefix, &dname.dname, tname,
                                              NULL);
                if (result == DNS_R_NAMETOOLONG) {
+                       if (chainingp != NULL) {
+                               *chainingp = ISC_TRUE;
+                       }
                        return (ISC_TRUE);
                }
                RUNTIME_CHECK(result == ISC_R_SUCCESS);