]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3453. [bug] 'rndc addzone' of a zone with 'inline-signing yes;'
authorMark Andrews <marka@isc.org>
Tue, 8 Jan 2013 20:40:27 +0000 (07:40 +1100)
committerMark Andrews <marka@isc.org>
Tue, 8 Jan 2013 20:40:27 +0000 (07:40 +1100)
                        failed. [RT #31960]

CHANGES
bin/tests/system/addzone/clean.sh
bin/tests/system/addzone/ns1/inlineslave.db [new file with mode: 0644]
bin/tests/system/addzone/ns1/named.conf [new file with mode: 0644]
bin/tests/system/addzone/ns2/inline.db [new file with mode: 0644]
bin/tests/system/addzone/setup.sh
bin/tests/system/addzone/tests.sh
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index f7a06783a6e274bf11ade61865c8174685adea31..3ddca1860994d2880f7239f545a25455a1d739e1 100644 (file)
--- 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.
index 190fce7753200a742e156238cdfd47db596e8a89..0ef40fb0ecca3d18bcfde71ab76d065607bea8e4 100644 (file)
@@ -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 (file)
index 0000000..e6eccc6
--- /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.
+
+$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 (file)
index 0000000..435e936
--- /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: 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 (file)
index 0000000..4f1ed78
--- /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.
+
+$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
index 1a8eb320b6582c7cfb11f525160e8bf22aef46c0..d175d5bcf9cb20489a3ec0ea18e47e66e91d1a33 100644 (file)
@@ -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
index 6b50f3eb2be8ca4f92db5202aeb8dc5c5dbff3f2..eeeb1d9e76bad150fc02819b812351e48cc78ea6 100644 (file)
@@ -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
index a1a5d1b5ad06f4fa64781fff39f9262c1aeff62e..e5d9aa79cedb04486cb8613704755abe235f693f 100644 (file)
@@ -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);