From: Mark Andrews Date: Tue, 8 Jan 2013 20:40:27 +0000 (+1100) Subject: 3453. [bug] 'rndc addzone' of a zone with 'inline-signing yes;' X-Git-Tag: v9.10.0a1~609 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=fc0bfa07c7b7aff70cf75e9414167e1f2d532845;p=thirdparty%2Fbind9.git 3453. [bug] 'rndc addzone' of a zone with 'inline-signing yes;' failed. [RT #31960] --- diff --git a/CHANGES b/CHANGES index f7a06783a6e..3ddca186099 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3453. [bug] 'rndc addzone' of a zone with 'inline-signing yes;' + failed. [RT #31960] + 3452. [bug] Accept duplicate singleton records. [RT #32329] 3451. [port] Increase per thread stack size from 64K to 1M. diff --git a/bin/tests/system/addzone/clean.sh b/bin/tests/system/addzone/clean.sh index 190fce77532..0ef40fb0ecc 100644 --- a/bin/tests/system/addzone/clean.sh +++ b/bin/tests/system/addzone/clean.sh @@ -22,3 +22,6 @@ rm -f ns2/named.conf rm -f */named.memstats rm -f ns2/*.nzf rm -f ns2/core* +rm -f ns2/inline.db.jbk +rm -f ns2/inline.db.signed +rm -f ns2/inlineslave.bk* diff --git a/bin/tests/system/addzone/ns1/inlineslave.db b/bin/tests/system/addzone/ns1/inlineslave.db new file mode 100644 index 00000000000..e6eccc66751 --- /dev/null +++ b/bin/tests/system/addzone/ns1/inlineslave.db @@ -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. + +$ORIGIN inlineslave.example. +$TTL 300 ; 5 minutes +@ IN SOA mname1. . ( + 1 ; serial + 20 ; refresh (20 seconds) + 20 ; retry (20 seconds) + 1814400 ; expire (3 weeks) + 3600 ; minimum (1 hour) + ) + NS ns2 +ns2 A 10.53.0.2 + MX 10 mail + +a A 10.0.0.1 +mail A 10.0.0.2 diff --git a/bin/tests/system/addzone/ns1/named.conf b/bin/tests/system/addzone/ns1/named.conf new file mode 100644 index 00000000000..435e9361998 --- /dev/null +++ b/bin/tests/system/addzone/ns1/named.conf @@ -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: named1.conf,v 1.2 2010/08/11 18:14:19 each Exp $ */ + +controls { /* empty */ }; + +options { + port 5300; + pid-file "named.pid"; + listen-on { 10.53.0.1; }; + listen-on-v6 { none; }; + allow-query { any; }; + recursion no; +}; + +zone "." { + type hint; + file "../../common/root.hint"; +}; + +zone "inlineslave.example" { + type master; + file "inlineslave.db"; +}; diff --git a/bin/tests/system/addzone/ns2/inline.db b/bin/tests/system/addzone/ns2/inline.db new file mode 100644 index 00000000000..4f1ed7819d5 --- /dev/null +++ b/bin/tests/system/addzone/ns2/inline.db @@ -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. + +$ORIGIN inline.example. +$TTL 300 ; 5 minutes +@ IN SOA mname1. . ( + 1 ; serial + 20 ; refresh (20 seconds) + 20 ; retry (20 seconds) + 1814400 ; expire (3 weeks) + 3600 ; minimum (1 hour) + ) + NS ns2 +ns2 A 10.53.0.2 + MX 10 mail + +a A 10.0.0.1 +mail A 10.0.0.2 diff --git a/bin/tests/system/addzone/setup.sh b/bin/tests/system/addzone/setup.sh index 1a8eb320b65..d175d5bcf9c 100644 --- a/bin/tests/system/addzone/setup.sh +++ b/bin/tests/system/addzone/setup.sh @@ -16,5 +16,7 @@ # $Id: setup.sh,v 1.3 2010/08/12 01:31:36 marka Exp $ +sh clean.sh + cp -f ns2/named1.conf ns2/named.conf cp -f ns2/default.nzf.in ns2/3bf305731dd26307.nzf diff --git a/bin/tests/system/addzone/tests.sh b/bin/tests/system/addzone/tests.sh index 6b50f3eb2be..eeeb1d9e76b 100644 --- a/bin/tests/system/addzone/tests.sh +++ b/bin/tests/system/addzone/tests.sh @@ -95,6 +95,44 @@ n=`expr $n + 1` if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` +echo "I:attempting to add master zone with inline signing ($n)" +$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 addzone 'inline.example { type master; file "inline.db"; inline-signing yes; };' 2>&1 | sed 's/^/I:ns2 /' +for i in 1 2 3 4 5 +do +ret=0 +$DIG $DIGOPTS @10.53.0.2 a.inline.example a > dig.out.ns2.$n || ret=1 +grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 +grep '^a.inline.example' dig.out.ns2.$n > /dev/null || ret=1 +[ $ret = 0 ] && break +sleep 1 +done +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:attempting to add master zone with inline signing and missing master ($n)" +ret=0 +$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 addzone 'inlinemissing.example { type master; file "missing.db"; inline-signing yes; };' 2> rndc.out.ns2.$n +grep "file not found" rndc.out.ns2.$n > /dev/null || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:attempting to add slave zone with inline signing ($n)" +$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 addzone 'inlineslave.example { type slave; masters { 10.53.0.1; }; file "inlineslave.bk"; inline-signing yes; };' 2>&1 | sed 's/^/I:ns2 /' +for i in 1 2 3 4 5 +do +ret=0 +$DIG $DIGOPTS @10.53.0.2 a.inlineslave.example a > dig.out.ns2.$n || ret=1 +grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 +grep '^a.inlineslave.example' dig.out.ns2.$n > /dev/null || ret=1 +[ $ret = 0 ] && break +sleep 1 +done +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + echo "I:reconfiguring server with multiple views" rm -f ns2/named.conf cp -f ns2/named2.conf ns2/named.conf diff --git a/lib/dns/zone.c b/lib/dns/zone.c index a1a5d1b5ad0..e5d9aa79ced 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -4220,6 +4220,8 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, if (!(inline_secure(zone) && result == ISC_R_FILENOTFOUND)) dns_zone_log(zone, ISC_LOG_ERROR, "not loaded due to errors."); + else if (zone->type == dns_zone_master) + result = ISC_R_SUCCESS; } return (result);