diff --git a/CHANGES b/CHANGES index 3c332f3f3d..11e04e2197 100644 --- 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] diff --git a/bin/tests/system/resolver/clean.sh b/bin/tests/system/resolver/clean.sh index 15bdf5407f..cb606bd4cf 100644 --- a/bin/tests/system/resolver/clean.sh +++ b/bin/tests/system/resolver/clean.sh @@ -14,14 +14,17 @@ # 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.7 2011/03/13 02:49:27 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 index 0000000000..b70294cff9 --- /dev/null +++ b/bin/tests/system/resolver/ns4/child.server.db @@ -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 2011/03/13 02:49:27 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 index 0000000000..2b0de762e3 --- /dev/null +++ b/bin/tests/system/resolver/ns4/moves.db @@ -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 2011/03/13 02:49:27 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" diff --git a/bin/tests/system/resolver/ns4/named.conf b/bin/tests/system/resolver/ns4/named.conf index 8624cd5116..ef1f0c772d 100644 --- a/bin/tests/system/resolver/ns4/named.conf +++ b/bin/tests/system/resolver/ns4/named.conf @@ -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.3 2011/03/13 02:49:27 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 index 0000000000..d0db1e2376 --- /dev/null +++ b/bin/tests/system/resolver/ns5/child.server.db @@ -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 2011/03/13 02:49:27 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 index 0000000000..7eb6e79260 --- /dev/null +++ b/bin/tests/system/resolver/ns5/moves.db @@ -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 2011/03/13 02:49:27 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" diff --git a/bin/tests/system/resolver/ns5/named.conf b/bin/tests/system/resolver/ns5/named.conf index 722007cba7..3b23601514 100644 --- a/bin/tests/system/resolver/ns5/named.conf +++ b/bin/tests/system/resolver/ns5/named.conf @@ -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.3 2011/03/13 02:49:27 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 index 0000000000..b01edde36a --- /dev/null +++ b/bin/tests/system/resolver/ns6/moves.db @@ -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 2011/03/13 02:49:27 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" diff --git a/bin/tests/system/resolver/ns6/root.db b/bin/tests/system/resolver/ns6/root.db index ca1c843b6a..8a4b25b1f5 100644 --- a/bin/tests/system/resolver/ns6/root.db +++ b/bin/tests/system/resolver/ns6/root.db @@ -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.3 2011/03/13 02:49:27 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 diff --git a/bin/tests/system/resolver/ns7/named.conf b/bin/tests/system/resolver/ns7/named.conf index 23e71c3694..3a28f433f8 100644 --- a/bin/tests/system/resolver/ns7/named.conf +++ b/bin/tests/system/resolver/ns7/named.conf @@ -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.3 2011/03/13 02:49:27 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 index 0000000000..6c843524f6 --- /dev/null +++ b/bin/tests/system/resolver/ns7/server.db.in @@ -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 2011/03/13 02:49:27 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 diff --git a/bin/tests/system/resolver/setup.sh b/bin/tests/system/resolver/setup.sh index 93778afefd..010c8f6490 100644 --- a/bin/tests/system/resolver/setup.sh +++ b/bin/tests/system/resolver/setup.sh @@ -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.4 2011/03/13 02:49:27 marka Exp $ ../../../tools/genrandom 400 random.data +cp ns7/server.db.in ns7/server.db (cd ns6 && sh keygen.sh) diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index 1598e88b0f..f4ff0edd03 100644 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -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.18 2011/03/13 02:49:27 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 diff --git a/lib/dns/adb.c b/lib/dns/adb.c index abe1e3dde8..a39564c799 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: adb.c,v 1.257 2011/03/11 06:11:23 marka Exp $ */ +/* $Id: adb.c,v 1.258 2011/03/13 02:49:28 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);