]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3074. [bug] Make the adb cache read through for zone data and
authorMark Andrews <marka@isc.org>
Sun, 13 Mar 2011 03:36:47 +0000 (03:36 +0000)
committerMark Andrews <marka@isc.org>
Sun, 13 Mar 2011 03:36:47 +0000 (03:36 +0000)
                        glue learn for zone named is authoritative for.
                        [RT #22842]

15 files changed:
CHANGES
bin/tests/system/resolver/clean.sh
bin/tests/system/resolver/ns4/child.server.db [new file with mode: 0644]
bin/tests/system/resolver/ns4/moves.db [new file with mode: 0644]
bin/tests/system/resolver/ns4/named.conf
bin/tests/system/resolver/ns5/child.server.db [new file with mode: 0644]
bin/tests/system/resolver/ns5/moves.db [new file with mode: 0644]
bin/tests/system/resolver/ns5/named.conf
bin/tests/system/resolver/ns6/moves.db [new file with mode: 0644]
bin/tests/system/resolver/ns6/root.db
bin/tests/system/resolver/ns7/named.conf
bin/tests/system/resolver/ns7/server.db.in [new file with mode: 0644]
bin/tests/system/resolver/setup.sh
bin/tests/system/resolver/tests.sh
lib/dns/adb.c

diff --git a/CHANGES b/CHANGES
index 211eae70f32a510fe5c9f00c4da881b0540c0e83..5e9d390eeeadaba926e6f7a5d1e778ffecc9b716 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3074.  [bug]           Make the adb cache read through for zone data and
+                       glue learn for zone named is authoritative for.
+                       [RT #22842]
+
 3073.  [bug]           managed-keys changes were not properly being recorded.
                        [RT #20256]
 
index 15bdf5407ff698b0273c88515d5dd1963cc4d80c..2b2e72d2545dc1b3297148394acbd0ab980be4ce 100644 (file)
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: clean.sh,v 1.6 2010/12/18 02:12:44 each Exp $
+# $Id: clean.sh,v 1.6.16.1 2011/03/13 03:36:45 marka Exp $
 
 #
 # Clean up after resolver tests.
 #
 rm -f */named.memstats
 rm -f dig.out dig.*.out.*
+rm -f dig.*.foo.*
+rm -f dig.*.bar.*
 rm -f ns6/K*
 rm -f ns6/example.net.db.signed ns6/example.net.db
 rm -f ns6/dsset-example.net. ns6/example.net.db.signed.jnl
+rm -f ns7/server.db ns7/server.db.jnl
 rm -f random.data
diff --git a/bin/tests/system/resolver/ns4/child.server.db b/bin/tests/system/resolver/ns4/child.server.db
new file mode 100644 (file)
index 0000000..6f41f0d
--- /dev/null
@@ -0,0 +1,28 @@
+; 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: child.server.db,v 1.2.2.2 2011/03/13 03:36:46 marka Exp $
+
+$TTL 300
+@                      IN SOA  marka.isc.org. ns.server. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+@                      NS      ns
+ns                     A       10.53.0.4
+foo                    TXT     "From NS 4"
+bar                    TXT     "From NS 4"
diff --git a/bin/tests/system/resolver/ns4/moves.db b/bin/tests/system/resolver/ns4/moves.db
new file mode 100644 (file)
index 0000000..8241e05
--- /dev/null
@@ -0,0 +1,27 @@
+; 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: moves.db,v 1.2.2.2 2011/03/13 03:36:46 marka Exp $
+
+$TTL 300
+@                      IN SOA  marka.isc.org. ns.server. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+@                      NS      ns.server.
+foo                    TXT     "From NS 4"
+bar                    TXT     "From NS 4"
index 8624cd5116a282d3bd162e9466e0f0c4eb0409c4..5b6e985756ea0f3c0e1185bc63ef5f51b2fd4196 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.2 2010/09/15 12:07:56 marka Exp $ */
+/* $Id: named.conf,v 1.2.60.1 2011/03/13 03:36:46 marka Exp $ */
 
 // NS4
 
@@ -36,3 +36,13 @@ zone "." {
        type master;
        file "root.db";
 };
+
+zone "moves" {
+       type master;
+       file "moves.db";
+};
+
+zone "child.server" {
+       type master;
+       file "child.server.db";
+};
diff --git a/bin/tests/system/resolver/ns5/child.server.db b/bin/tests/system/resolver/ns5/child.server.db
new file mode 100644 (file)
index 0000000..d720257
--- /dev/null
@@ -0,0 +1,28 @@
+; 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: child.server.db,v 1.2.2.2 2011/03/13 03:36:46 marka Exp $
+
+$TTL 300
+@                      IN SOA  marka.isc.org. ns.server. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+@                      NS      ns
+ns                     A       10.53.0.5
+foo                    TXT     "From NS 5"
+bar                    TXT     "From NS 5"
diff --git a/bin/tests/system/resolver/ns5/moves.db b/bin/tests/system/resolver/ns5/moves.db
new file mode 100644 (file)
index 0000000..7aeec72
--- /dev/null
@@ -0,0 +1,27 @@
+; 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: moves.db,v 1.2.2.2 2011/03/13 03:36:46 marka Exp $
+
+$TTL 300
+@                      IN SOA  marka.isc.org. ns.server. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+@                      NS      ns.server.
+foo                    TXT     "From NS 5"
+bar                    TXT     "From NS 5"
index 722007cba744b91ca1ef6eb92deebd2777f9b427..5189a2caaa3990f5d3dfa5c29b07dfd7b1de949d 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.2 2010/09/15 12:07:56 marka Exp $ */
+/* $Id: named.conf,v 1.2.60.1 2011/03/13 03:36:46 marka Exp $ */
 
 // NS4
 
@@ -35,3 +35,13 @@ zone "." {
        type hint;
        file "root.hint";
 };
+
+zone "moves" {
+       type master;
+       file "moves.db";
+};
+
+zone "child.server" {
+       type master;
+       file "child.server.db";
+};
diff --git a/bin/tests/system/resolver/ns6/moves.db b/bin/tests/system/resolver/ns6/moves.db
new file mode 100644 (file)
index 0000000..7b8d504
--- /dev/null
@@ -0,0 +1,27 @@
+; 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: moves.db,v 1.2.2.2 2011/03/13 03:36:46 marka Exp $
+
+$TTL 300
+@                      IN SOA  marka.isc.org. ns.server. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+@                      NS      ns.server.
+foo                    TXT     "From NS 6"
+bar                    TXT     "From NS 6"
index ca1c843b6a104865d86868b19133f67f64da88c4..15a26886c90141e173010fa3a0d4e06a21ccf23c 100644 (file)
@@ -12,7 +12,7 @@
 ; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 ; PERFORMANCE OF THIS SOFTWARE.
 
-; $Id: root.db,v 1.2 2010/11/16 06:46:44 marka Exp $
+; $Id: root.db,v 1.2.50.1 2011/03/13 03:36:46 marka Exp $
 
 $TTL 300
 .                      IN SOA  marka.isc.org. a.root.servers.nil. (
@@ -24,3 +24,6 @@ $TTL 300
                                )
 .                      NS      a.root-servers.nil.
 a.root-servers.nil.    A       10.53.0.6
+moves.                 NS      ns.server.
+server.                        NS      ns7.server.
+ns7.server.            A       10.53.0.7
index 23e71c3694eabf59ba03793e0f638aa9ac2c609d..5eb400790d29651f6a5899ef9c6740516487696d 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.2 2010/11/16 06:46:44 marka Exp $ */
+/* $Id: named.conf,v 1.2.50.1 2011/03/13 03:36:46 marka Exp $ */
 
 // NS4
 
@@ -35,3 +35,9 @@ zone "." {
        type hint;
        file "root.hint";
 };
+
+zone "server" {
+       type master;
+       file "server.db";
+       allow-update { any; };
+};
diff --git a/bin/tests/system/resolver/ns7/server.db.in b/bin/tests/system/resolver/ns7/server.db.in
new file mode 100644 (file)
index 0000000..a71b768
--- /dev/null
@@ -0,0 +1,29 @@
+; 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: server.db.in,v 1.2.2.2 2011/03/13 03:36:47 marka Exp $
+
+$TTL 300
+@                      IN SOA  marka.isc.org. a.root.servers.nil. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+@                      NS      ns7
+ns7                    A       10.53.0.7
+ns                     A       10.53.0.5
+child                  NS      ns.child
+ns.child               A       10.53.0.5
index 93778afefdfa01bd7d3f03edd0c6719ccfe85927..bee6783dca6240d768ef35de83eb0e7070bcb8e8 100644 (file)
@@ -14,8 +14,9 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: setup.sh,v 1.3 2010/11/17 23:47:08 tbox Exp $
+# $Id: setup.sh,v 1.3.38.1 2011/03/13 03:36:45 marka Exp $
 
 ../../../tools/genrandom 400 random.data
 
+cp ns7/server.db.in ns7/server.db
 (cd ns6 && sh keygen.sh)
index 1598e88b0f890eb8277b490ac217b4306f015833..9df47522128836492b81195d0855030ef503c7a4 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: tests.sh,v 1.17 2010/11/16 06:46:44 marka Exp $
+# $Id: tests.sh,v 1.17.38.1 2011/03/13 03:36:45 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -181,5 +181,45 @@ grep "ANSWER: 0" dig.ns7.out.${n} > /dev/null || ret=4
 if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
 status=`expr $status + $ret`
 
+if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo "I:checking that update a nameservers address has immediate effects ($n)"
+ret=0
+$DIG +tcp TXT foo.moves @10.53.0.7 -p 5300 > dig.ns7.foo.${n} || ret=1
+grep "From NS 5" dig.ns7.foo.${n} > /dev/null || ret=1 
+$NSUPDATE << EOF
+server 10.53.0.7 5300
+zone server
+update delete ns.server A
+update add ns.server 300 A 10.53.0.4
+send
+EOF
+sleep 1
+$DIG +tcp TXT bar.moves @10.53.0.7 -p 5300 > dig.ns7.bar.${n} || ret=1
+grep "From NS 4" dig.ns7.bar.${n} > /dev/null || ret=1
+
+if [ $ret != 0 ]; then echo "I:failed"; status=1; fi
+
+n=`expr $n + 1`
+echo "I:checking that update a nameservers glue has immediate effects ($n)"
+ret=0
+$DIG +tcp TXT foo.child.server @10.53.0.7 -p 5300 > dig.ns7.foo.${n} || ret=1
+grep "From NS 5" dig.ns7.foo.${n} > /dev/null || ret=1 
+$NSUPDATE << EOF
+server 10.53.0.7 5300
+zone server
+update delete ns.child.server A
+update add ns.child.server 300 A 10.53.0.4
+send
+EOF
+sleep 1
+$DIG +tcp TXT bar.child.server @10.53.0.7 -p 5300 > dig.ns7.bar.${n} || ret=1
+grep "From NS 4" dig.ns7.bar.${n} > /dev/null || ret=1
+
+if [ $ret != 0 ]; then echo "I:failed"; status=1; fi
+
 echo "I:exit status: $status"
+
 exit $status
index d1843b616fa9f39af2ed2305d801f8183e9ac951..289964156f2cfee2a04fd936393b948401e5f195 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: adb.c,v 1.254.14.3 2011/03/11 06:47:02 marka Exp $ */
+/* $Id: adb.c,v 1.254.14.4 2011/03/13 03:36:47 marka Exp $ */
 
 /*! \file
  *
@@ -910,6 +910,8 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
        if (rdataset->trust == dns_trust_glue ||
            rdataset->trust == dns_trust_additional)
                rdataset->ttl = ADB_CACHE_MINIMUM;
+       else if (rdataset->trust == dns_trust_ultimate)
+               rdataset->ttl = 0;
        else
                rdataset->ttl = ttlclamp(rdataset->ttl);