]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2960. [func] Check that named accepts non-authoritative answers.
authorMark Andrews <marka@isc.org>
Wed, 15 Sep 2010 12:13:30 +0000 (12:13 +0000)
committerMark Andrews <marka@isc.org>
Wed, 15 Sep 2010 12:13:30 +0000 (12:13 +0000)
                        [RT #21594]

CHANGES
bin/named/include/named/globals.h
bin/named/main.c
bin/named/query.c
bin/tests/system/resolver/ns4/named.conf [new file with mode: 0644]
bin/tests/system/resolver/ns4/named.noaa [new file with mode: 0644]
bin/tests/system/resolver/ns4/root.db [new file with mode: 0644]
bin/tests/system/resolver/ns5/named.conf [new file with mode: 0644]
bin/tests/system/resolver/ns5/root.hint [new file with mode: 0644]
bin/tests/system/resolver/tests.sh
bin/tests/system/start.pl

diff --git a/CHANGES b/CHANGES
index d318569827df1547cdd90d31c6933c0289dfeea5..ea1b61990ca30a5e202a3f311d7a02004fe125e3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2960.  [func]          Check that named accepts non-authoritative answers.
+                       [RT #21594]
+
 2959.  [func]          Check that named starts with a missing masterfile.
                        [RT #22076]
 
index f5d80b532df1c5c2e93d8d24cee0bef3eed09165..fd326a7aaf77b94f5145bb9068b9a7d8e483bcb8 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: globals.h,v 1.86.60.2 2010/06/26 23:46:27 tbox Exp $ */
+/* $Id: globals.h,v 1.86.60.2.8.1 2010/09/15 12:13:29 marka Exp $ */
 
 #ifndef NAMED_GLOBALS_H
 #define NAMED_GLOBALS_H 1
@@ -150,6 +150,7 @@ EXTERN isc_time_t           ns_g_boottime;
 EXTERN isc_boolean_t           ns_g_memstatistics      INIT(ISC_FALSE);
 EXTERN isc_boolean_t           ns_g_clienttest         INIT(ISC_FALSE);
 EXTERN isc_boolean_t           ns_g_nosoa              INIT(ISC_FALSE);
+EXTERN isc_boolean_t           ns_g_noaa               INIT(ISC_FALSE);
 
 #undef EXTERN
 #undef INIT
index c4364dcedf2af66c60a0a11dd79667c063e4e177..6b36277d1827ed66ff63c3b11051b8cce03e230c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: main.c,v 1.175.60.3 2010/06/26 23:46:27 tbox Exp $ */
+/* $Id: main.c,v 1.175.60.3.8.1 2010/09/15 12:13:29 marka Exp $ */
 
 /*! \file */
 
@@ -509,6 +509,8 @@ parse_command_line(int argc, char *argv[]) {
                                ns_g_clienttest = ISC_TRUE;
                        else if (!strcmp(isc_commandline_argument, "nosoa"))
                                ns_g_nosoa = ISC_TRUE;
+                       else if (!strcmp(isc_commandline_argument, "noaa"))
+                               ns_g_noaa = ISC_TRUE;
                        else if (!strcmp(isc_commandline_argument, "maxudp512"))
                                maxudp = 512;
                        else if (!strcmp(isc_commandline_argument, "maxudp1460"))
index bd5e166080dd3b0edb95d9547fea076ee756db6a..ac53b9ed0221e0dabd065e5a4c27f0f1057c42b7 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.335.8.8 2010/07/15 01:26:10 jinmei Exp $ */
+/* $Id: query.c,v 1.335.8.8.6.1 2010/09/15 12:13:29 marka Exp $ */
 
 /*! \file */
 
@@ -5364,8 +5364,12 @@ ns_query_start(ns_client_t *client) {
        /*
         * Assume authoritative response until it is known to be
         * otherwise.
+        *
+        * If "-T noaa" has been set on the command line don't set
+        * AA on authoritative answers.
         */
-       message->flags |= DNS_MESSAGEFLAG_AA;
+       if (!ns_g_noaa)
+               message->flags |= DNS_MESSAGEFLAG_AA;
 
        /*
         * Set AD.  We must clear it if we add non-validated data to a
diff --git a/bin/tests/system/resolver/ns4/named.conf b/bin/tests/system/resolver/ns4/named.conf
new file mode 100644 (file)
index 0000000..4bbd79f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010  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.
+ */
+
+/* $Id: named.conf,v 1.2.4.2 2010/09/15 12:13:29 marka Exp $ */
+
+// NS4
+
+controls { /* empty */ };
+
+options {
+       query-source address 10.53.0.4;
+       notify-source 10.53.0.4;
+       transfer-source 10.53.0.4;
+       port 5300;
+       pid-file "named.pid";
+       listen-on { 10.53.0.4; };
+       listen-on-v6 { none; };
+       recursion no;
+       // minimal-responses yes;
+};
+
+zone "." {
+       type master;
+       file "root.db";
+};
diff --git a/bin/tests/system/resolver/ns4/named.noaa b/bin/tests/system/resolver/ns4/named.noaa
new file mode 100644 (file)
index 0000000..971ef25
--- /dev/null
@@ -0,0 +1,6 @@
+Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
+
+$Id: named.noaa,v 1.2.4.2 2010/09/15 12:13:29 marka Exp $
+
+Add -T noaa.
diff --git a/bin/tests/system/resolver/ns4/root.db b/bin/tests/system/resolver/ns4/root.db
new file mode 100644 (file)
index 0000000..e8f91af
--- /dev/null
@@ -0,0 +1,26 @@
+; Copyright (C) 2010  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.
+
+; $Id: root.db,v 1.2.4.2 2010/09/15 12:13:30 marka Exp $
+
+$TTL 300
+.                      IN SOA  marka.isc.org. a.root.servers.nil. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+.                      NS      a.root-servers.nil.
+a.root-servers.nil.    A       10.53.0.4
diff --git a/bin/tests/system/resolver/ns5/named.conf b/bin/tests/system/resolver/ns5/named.conf
new file mode 100644 (file)
index 0000000..c4ca22a
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010  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.
+ */
+
+/* $Id: named.conf,v 1.2.4.2 2010/09/15 12:13:30 marka Exp $ */
+
+// NS4
+
+controls { /* empty */ };
+
+options {
+       query-source address 10.53.0.5;
+       notify-source 10.53.0.5;
+       transfer-source 10.53.0.5;
+       port 5300;
+       pid-file "named.pid";
+       listen-on { 10.53.0.5; };
+       listen-on-v6 { none; };
+       recursion yes;
+};
+
+zone "." {
+       type hint;
+       file "root.hint";
+};
diff --git a/bin/tests/system/resolver/ns5/root.hint b/bin/tests/system/resolver/ns5/root.hint
new file mode 100644 (file)
index 0000000..0532f39
--- /dev/null
@@ -0,0 +1,19 @@
+; Copyright (C) 2010  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.
+
+; $Id: root.hint,v 1.2.4.2 2010/09/15 12:13:30 marka Exp $
+
+$TTL 999999
+.                       IN NS  a.root-servers.nil.
+a.root-servers.nil.     IN A   10.53.0.4
index 929558ecb87cc50a746912963a0b1eb357441abe..087483ff27beaa4d21a694181ae7c528069bcb79 100644 (file)
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.11.142.2 2010/05/19 09:32:36 tbox Exp $
+# $Id: tests.sh,v 1.11.142.2.18.1 2010/09/15 12:13:29 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
 status=0
+n=0
 
 echo "I:checking non-cachable NXDOMAIN response handling"
 ret=0
@@ -119,6 +120,41 @@ grep "status: NOERROR" dig.out > /dev/null || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo "I: RT21594 regression test check setup ($n)"
+ret=0
+# Check that "aa" is not being set by the authoritative server.
+$DIG +tcp . @10.53.0.4 soa -p 5300 > dig.ns4.out.${n} || ret=1
+grep 'flags:\( \(qr\|rd\|ra\|cd\|ad\)\)* *;' dig.ns4.out.${n} > /dev/null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo "I: RT21594 regression test positive answers ($n)"
+ret=0
+# Check that resolver accepts the non-authoritative positive answers.
+$DIG +tcp . @10.53.0.5 soa -p 5300 > dig.ns5.out.${n} || ret=1
+grep "status: NOERROR" dig.ns5.out.${n} > /dev/null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo "I: RT21594 regression test NODATA answers ($n)"
+ret=0
+# Check that resolver accepts the non-authoritative nodata answers.
+$DIG +tcp . @10.53.0.5 txt -p 5300 > dig.ns5.out.${n} || ret=1
+grep "status: NOERROR" dig.ns5.out.${n} > /dev/null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo "I: RT21594 regression test NXDOMAIN answers ($n)"
+ret=0
+# Check that resolver accepts the non-authoritative positive answers.
+$DIG +tcp noexistant @10.53.0.5 txt -p 5300 > dig.ns5.out.${n} || ret=1
+grep "status: NXDOMAIN" dig.ns5.out.${n} > /dev/null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
 
 echo "I:exit status: $status"
 exit $status
index 6aa1854e12d17b38ee660285d582e3158119b211..b4afa2b39ab85d6cde0639357b7796be244f5dde 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: start.pl,v 1.13.396.2 2010/06/26 23:46:27 tbox Exp $
+# $Id: start.pl,v 1.13.396.2.8.1 2010/09/15 12:13:29 marka Exp $
 
 # Framework for starting test servers.
 # Based on the type of server specified, check for port availability, remove
@@ -133,6 +133,8 @@ sub start_server {
                        $command .= "-T clienttest ";
                        $command .= "-T nosoa " 
                                if (-e "$testdir/$server/named.nosoa");
+                       $command .= "-T noaa " 
+                               if (-e "$testdir/$server/named.noaa");
                        $command .= "-c named.conf -d 99 -g";
                }
                $command .= " >named.run 2>&1 &";