]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3645. [protocol] Use case sensitive compression when responding to
authorMark Andrews <marka@isc.org>
Wed, 18 Sep 2013 06:16:06 +0000 (16:16 +1000)
committerMark Andrews <marka@isc.org>
Wed, 18 Sep 2013 07:17:37 +0000 (17:17 +1000)
                        queries. [RT #34737]

(cherry picked from commit cb69994ff89179166d5e21ccc7a34223b51676c0)

CHANGES
README
bin/named/client.c
bin/tests/system/cacheclean/tests.sh
bin/tests/system/case/clean.sh [new file with mode: 0644]
bin/tests/system/case/ns1/example.db [new file with mode: 0644]
bin/tests/system/case/ns1/named.conf [new file with mode: 0644]
bin/tests/system/case/tests.sh [new file with mode: 0644]
bin/tests/system/conf.sh.in
bin/tests/system/digcomp.pl
bin/tests/system/glue/tests.sh

diff --git a/CHANGES b/CHANGES
index 2c8056bd801dc3451bb9d5ac59d699b6eca04042..c1528734aecd5fe6645c082370ff532c7935828c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@
 3646.  [bug]           Journal filename string could be set incorrectly,
                        causing garbage in log messages. [RT #34738]
 
+3645.  [protocol]      Use case sensitive compression when responding to
+                       queries. [RT #34737]
+
 3644.  [protocol]      Check that EDNS subnet client options are well formed.
                        [RT #34718]
 
diff --git a/README b/README
index 2216ab775b5abc0efb3c8dfd2387ef2adbe05a25..0324c3af16bbe1c71c21d71ef2a96a203791db91 100644 (file)
--- a/README
+++ b/README
@@ -48,6 +48,11 @@ BIND 9
         For up-to-date release notes and errata, see
         http://www.isc.org/software/bind9/releasenotes
 
+BIND 9.6-ESV-R11 (Extended Support Version)
+       - "named" now preserves the capitalization of names when
+          responding to queries.
+
 BIND 9.6-ESV-R10 (Extended Support Version)
 
        BIND 9.6-ESV-R10 is a maintenance release, fixing bugs in BIND
index 6e542dea2cef807eccfa854926589077bd07425f..57729d6e87f8258c58033d6b1895467e875a0a76 100644 (file)
@@ -954,6 +954,7 @@ ns_client_send(ns_client_t *client) {
        result = dns_compress_init(&cctx, -1, client->mctx);
        if (result != ISC_R_SUCCESS)
                goto done;
+       dns_compress_setsensitive(&cctx, ISC_TRUE);
        cleanup_cctx = ISC_TRUE;
 
        result = dns_message_renderbegin(client->message, &cctx, &buffer);
index 94cb330152f0d0a53e7be2ec6cbb151d23e124ce..2884a426a636483e185ae751a1aaeba327414ffa 100644 (file)
@@ -26,7 +26,7 @@ $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat \
        -f dig.batch -p 5300 @10.53.0.2 > dig.out.ns2 || status=1
 grep ";" dig.out.ns2
 
-$PERL ../digcomp.pl dig.out.ns2 knowngood.dig.out || status=1
+$PERL ../digcomp.pl --lc dig.out.ns2 knowngood.dig.out || status=1
 
 echo "I:exit status: $status"
 exit $status
diff --git a/bin/tests/system/case/clean.sh b/bin/tests/system/case/clean.sh
new file mode 100644 (file)
index 0000000..40fc402
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+rm -f dig.n1.test1
diff --git a/bin/tests/system/case/ns1/example.db b/bin/tests/system/case/ns1/example.db
new file mode 100644 (file)
index 0000000..961315e
--- /dev/null
@@ -0,0 +1,27 @@
+; Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted, provided that the above
+; copyright notice and this permission notice appear in all copies.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+
+$TTL 300       ; 5 minutes
+@                      IN SOA  mname1. . (
+                               2000042407 ; serial
+                               20         ; refresh (20 seconds)
+                               20         ; retry (20 seconds)
+                               1814400    ; expire (3 weeks)
+                               3600       ; minimum (1 hour)
+                               )
+                       NS      ns1
+ns1                    A       10.53.0.1
+@                      MX      0 mail.eXaMpLe.
+mAiL                   A       10.53.0.1
diff --git a/bin/tests/system/case/ns1/named.conf b/bin/tests/system/case/ns1/named.conf
new file mode 100644 (file)
index 0000000..2fcc608
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+controls { /* empty */ };
+
+options {
+       query-source address 10.53.0.1;
+       notify-source 10.53.0.1;
+       transfer-source 10.53.0.1;
+       port 5300;
+       pid-file "named.pid";
+       listen-on { 10.53.0.1; };
+       listen-on-v6 { none; };
+       recursion no;
+       notify yes;
+       ixfr-from-differences yes;
+       check-integrity no;
+};
+
+zone "example" {
+       type master;
+       file "example.db";
+};
diff --git a/bin/tests/system/case/tests.sh b/bin/tests/system/case/tests.sh
new file mode 100644 (file)
index 0000000..d9c159b
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+SYSTEMTESTTOP=..
+. $SYSTEMTESTTOP/conf.sh
+
+DIGOPTS="+tcp +nosea +nostat +noquest +nocomm +nocmd"
+
+status=0
+n=0
+
+n=`expr $n + 1`
+echo "I:testing case sensitive responses ($n)"
+ret=0
+$DIG $DIGOPTS mx example. @10.53.0.1 -p 5300 > dig.n1.test$n
+grep "0.mail.eXaMpLe" dig.n1.test$n > /dev/null || ret=1
+grep "mAiL.example" dig.n1.test$n > /dev/null || ret=1
+test $ret -eq 0 || echo "I:failed"
+status=`expr $status + $ret`
+
+echo "I:exit status: $status"
+exit $status
index f4bd623747d922d46cfff3aae673b83adc576d7b..1a6d153796517ec6ca979ad4f41f963ae8b0d0cc 100644 (file)
@@ -43,7 +43,7 @@ CHECKCONF=$TOP/bin/check/named-checkconf
 # The "stress" test is not run by default since it creates enough
 # load on the machine to make it unusable to other users.
 # v6synth
-SUBDIRS="acl additional allow_query builtin cacheclean checkconf
+SUBDIRS="acl additional allow_query builtin cacheclean case checkconf
         checknames checkzone database dlv dlz dname dnssec formerr
         forward glue ixfr limits logfileconfig lwresd masterfile
         masterformat notify nsupdate pending resolver rndc rrsetorder
index 28ee067d3327b1c1541b5d10940d47b1cffe90ec..e2ff72e9bf622c31203b43719599d32d9b85638b 100644 (file)
 # Ignore "unimportant" differences, like ordering of NS lines, TTL's,
 # etc...
 
+$lc = 0;
+if ($ARGV[0] eq "--lc") {
+       $lc = 1;
+       shift;
+}
 $file1 = $ARGV[0];
 $file2 = $ARGV[1];
 
@@ -42,6 +47,10 @@ while (<FILE1>) {
                $class = $2;
                $type = $3;
                $value = $4;
+               if ($lc) {
+                       $name = lc($name);
+                       $value = lc($value);
+               }
                if ($type eq "SOA") {
                        $firstname = $name if ($firstname eq "");
                        if ($name eq $firstname) {
@@ -73,6 +82,10 @@ while (<FILE2>) {
                $class = $2;
                $type = $3;
                $value = $4;
+               if ($lc) {
+                       $name = lc($name);
+                       $value = lc($value);
+               }
                if (($name eq $firstname) && ($type eq "SOA")) {
                        $count--;
                        $name = "$name$count";
index 32181ec9e0c50cbbc4c7552134a42acf0a492fb2..b6cbd7e40bdec9346bf6d893b170f9d72da33e61 100644 (file)
@@ -28,7 +28,7 @@ status=0
 
 echo "I:testing that a ccTLD referral gets a full glue set from the root zone"
 $DIG +norec @10.53.0.1 -p 5300 foo.bar.fi. A >dig.out || status=1
-$PERL ../digcomp.pl fi.good dig.out || status=1
+$PERL ../digcomp.pl --lc fi.good dig.out || status=1
 
 echo "I:testing that we find glue A RRs we are authoritative for"
 $DIG +norec @10.53.0.1 -p 5300 foo.bar.xx. a >dig.out || status=1