]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3067. [bug] ixfr-from-differences {master|slave}; failed to
authorMark Andrews <marka@isc.org>
Fri, 11 Mar 2011 00:57:38 +0000 (00:57 +0000)
committerMark Andrews <marka@isc.org>
Fri, 11 Mar 2011 00:57:38 +0000 (00:57 +0000)
                        select the master/slave zones.  [RT #23580]

CHANGES
bin/named/zoneconf.c
bin/tests/system/common/rndc.key [new file with mode: 0644]
bin/tests/system/xfer/clean.sh
bin/tests/system/xfer/ns1/named.conf
bin/tests/system/xfer/ns3/named.conf
bin/tests/system/xfer/ns6/named.conf [new file with mode: 0644]
bin/tests/system/xfer/ns7/named.conf [new file with mode: 0644]
bin/tests/system/xfer/setup.sh
bin/tests/system/xfer/tests.sh

diff --git a/CHANGES b/CHANGES
index 706db37cb7d7067c6b698a625393469e4cbb972a..48551d40ac92429e9d88f4a76fe099a549cc73be 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3067.  [bug]           ixfr-from-differences {master|slave}; failed to
+                       select the master/slave zones.  [RT #23580]
+
 3065.  [bug]           RRSIG could have time stamps too far in the future.
                        [RT #23356]
 
index a0c1babd6d0e3836c5627c7425296131b81e9e74..7b61ba83297eb56f01a004b5519e435008105a34 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zoneconf.c,v 1.110.18.23 2006/05/16 03:39:57 marka Exp $ */
+/* $Id: zoneconf.c,v 1.110.18.24 2011/03/11 00:57:37 marka Exp $ */
 
 /*% */
 
@@ -582,10 +582,10 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                INSIST(result == ISC_R_SUCCESS);
                if (cfg_obj_isboolean(obj))
                        ixfrdiff = cfg_obj_asboolean(obj);
-               else if (strcasecmp(cfg_obj_asstring(obj), "master") &&
+               else if (!strcasecmp(cfg_obj_asstring(obj), "master") &&
                         ztype == dns_zone_master)
                        ixfrdiff = ISC_TRUE;
-               else if (strcasecmp(cfg_obj_asstring(obj), "slave") &&
+               else if (!strcasecmp(cfg_obj_asstring(obj), "slave") &&
                        ztype == dns_zone_slave)
                        ixfrdiff = ISC_TRUE;
                else
diff --git a/bin/tests/system/common/rndc.key b/bin/tests/system/common/rndc.key
new file mode 100644 (file)
index 0000000..862f119
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001  Internet Software Consortium.
+ *
+ * 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: rndc.key,v 1.2.8.2 2011/03/11 00:57:37 marka Exp $ */
+
+key rndc_key {
+        secret "1234abcd8765";
+        algorithm hmac-md5;
+};
index 1f85aadbfbb9cdcfbfad9bae91e7eb259e6d8c09..1ab704360f867b1685cc88d754090286cf9ce028 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.11.18.2 2008/01/22 23:27:05 tbox Exp $
+# $Id: clean.sh,v 1.11.18.3 2011/03/11 00:57:37 marka Exp $
 
 #
 # Clean up after zone transfer tests.
 #
 
-rm -f dig.out.ns2 dig.out.ns3
+rm -f dig.out.ns1 dig.out.ns2 dig.out.ns3
+rm -f dig.out.ns5 dig.out.ns6 dig.out.ns7
+rm -f ns1/slave.db
 rm -f ns2/example.db ns2/tsigzone.db ns2/example.db.jnl
 rm -f ns3/example.bk ns3/tsigzone.bk ns3/example.bk.jnl
+rm -f ns3/master.bk ns3/master.bk.jnl
+rm -f ns4/named.conf ns4/nil.db
+rm -f ns6/*.db ns6/*.bk ns6/*.jnl
+rm -f ns7/*.db ns7/*.bk ns7/*.jnl
+
 rm -f */named.memstats
+rm -f */named.run
+rm -f */ans.run
index 3e987cb423e0e194e5a8f079f06833e41ce5b960..87b822cbe5a379e0535fb3a1507993dcf44e8695 100644 (file)
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.16 2004/03/05 05:03:57 marka Exp $ */
+/* $Id: named.conf,v 1.16.18.1 2011/03/11 00:57:38 marka Exp $ */
 
-controls { /* empty */ };
+include "../../common/rndc.key";
+
+controls {
+        inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
+};
 
 options {
        query-source address 10.53.0.1;
@@ -35,3 +39,8 @@ zone "." {
        type master;
        file "root.db";
 };
+
+zone "slave" {
+       type master;
+       file "slave.db";
+};
index 353395484a9bf07ab38418d2aa9c0a8874f32ee7..4eaea3d0aa5f68428ac40eeeab75bda21926d2d4 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.18.18.3 2007/08/28 07:20:02 tbox Exp $ */
+/* $Id: named.conf,v 1.18.18.4 2011/03/11 00:57:38 marka Exp $ */
 
 controls { /* empty */ };
 
@@ -57,6 +57,12 @@ zone "example" {
        file "example.bk";
 };
 
+zone "master" {
+       type slave;
+       masters { 10.53.0.6; };
+       file "master.bk";
+};
+
 server 10.53.0.2 {
        keys { tsigzone.; };
 };
diff --git a/bin/tests/system/xfer/ns6/named.conf b/bin/tests/system/xfer/ns6/named.conf
new file mode 100644 (file)
index 0000000..d936513
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001  Internet Software Consortium.
+ *
+ * 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.8.2 2011/03/11 00:57:38 marka Exp $ */
+
+include "../../common/rndc.key";
+
+controls {
+        inet 10.53.0.6 port 9953 allow { any; } keys { rndc_key; };
+};
+
+options {
+       query-source address 10.53.0.6;
+       notify-source 10.53.0.6;
+       transfer-source 10.53.0.6;
+       port 5300;
+       pid-file "named.pid";
+       listen-on { 10.53.0.6; };
+       listen-on-v6 { none; };
+       recursion no;
+       notify yes;
+       ixfr-from-differences master;
+       check-integrity no;
+};
+
+zone "." {
+       type hint;
+       file "../../common/root.hint";
+};
+
+zone "master" {
+       type master;
+       file "master.db";
+};
+
+zone "slave" {
+       type slave;
+       notify no;
+       masters { 10.53.0.1; };
+       file "slave.bk";
+};
diff --git a/bin/tests/system/xfer/ns7/named.conf b/bin/tests/system/xfer/ns7/named.conf
new file mode 100644 (file)
index 0000000..5c87b9b
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001  Internet Software Consortium.
+ *
+ * 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.8.2 2011/03/11 00:57:38 marka Exp $ */
+
+include "../../common/rndc.key";
+
+controls {
+        inet 10.53.0.7 port 9953 allow { any; } keys { rndc_key; };
+};
+
+options {
+       query-source address 10.53.0.7;
+       notify-source 10.53.0.7;
+       transfer-source 10.53.0.7;
+       port 5300;
+       pid-file "named.pid";
+       listen-on { 10.53.0.7; };
+       listen-on-v6 { none; };
+       recursion no;
+       notify yes;
+       ixfr-from-differences slave;
+       check-integrity no;
+};
+
+zone "." {
+       type hint;
+       file "../../common/root.hint";
+};
+
+zone "master2" {
+       type master;
+       file "master2.db";
+};
+
+zone "slave" {
+       type slave;
+       masters { 10.53.0.1; };
+       file "slave.bk";
+};
index 965a36da385aede8d2f0c47e69d85960015789a2..c5deca5590943bf1d3fe8292536bb8461cfe35f0 100644 (file)
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: setup.sh,v 1.3 2004/03/05 05:03:55 marka Exp $
+# $Id: setup.sh,v 1.3.18.1 2011/03/11 00:57:38 marka Exp $
 
+sh clean.sh
+
+sh ../genzone.sh 1 6 7 >ns1/slave.db
 sh ../genzone.sh 2 3 >ns2/example.db
 sh ../genzone.sh 2 3 >ns2/tsigzone.db
+sh ../genzone.sh 6 3 >ns6/master.db
+sh ../genzone.sh 7 >ns7/master2.db
index e4f1c9d2e2de83fa86e231335839848547052487..429a5247753fa6f042feb4d1fecdbf29b57ff735 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.27.18.4 2008/01/22 23:27:05 tbox Exp $
+# $Id: tests.sh,v 1.27.18.5 2011/03/11 00:57:38 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -74,7 +74,24 @@ grep ";" dig.out.ns3
 
 $PERL ../digcomp.pl dig.out.ns2 dig.out.ns3 || status=1
 
-echo "I:testing ixfr-from-differences"
+echo "I:reload servers for in preparation for ixfr-from-differences tests"
+
+$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload 2>&1 | sed 's/^/I:ns1 /'
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
+$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reload 2>&1 | sed 's/^/I:ns3 /'
+$RNDC -c ../common/rndc.conf -s 10.53.0.6 -p 9953 reload 2>&1 | sed 's/^/I:ns6 /'
+$RNDC -c ../common/rndc.conf -s 10.53.0.7 -p 9953 reload 2>&1 | sed 's/^/I:ns7 /'
+
+sleep 2
+
+echo "I:updating master zones for ixfr-from-differences tests"
+
+$PERL -i -p -e '
+       s/0\.0\.0\.0/0.0.0.1/;
+       s/1397051952/1397051953/
+' ns1/slave.db
+
+$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload 2>&1 | sed 's/^/I:ns1 /'
 
 $PERL -i -p -e '
        s/0\.0\.0\.0/0.0.0.1/;
@@ -83,20 +100,106 @@ $PERL -i -p -e '
 
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
 
-sleep 5
+$PERL -i -p -e '
+       s/0\.0\.0\.0/0.0.0.1/;
+       s/1397051952/1397051953/
+' ns6/master.db
 
-$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reload 2>&1 | sed 's/^/I:ns3 /'
+$RNDC -c ../common/rndc.conf -s 10.53.0.6 -p 9953 reload 2>&1 | sed 's/^/I:ns6 /'
+
+$PERL -i -p -e '
+       s/0\.0\.0\.0/0.0.0.1/;
+       s/1397051952/1397051953/
+' ns7/master2.db
+
+$RNDC -c ../common/rndc.conf -s 10.53.0.7 -p 9953 reload 2>&1 | sed 's/^/I:ns7 /'
 
-sleep 5
+sleep 3
+
+echo "I:testing ixfr-from-differences yes;"
+tmp=0
 
 $DIG $DIGOPTS example. \
-       @10.53.0.3 axfr -p 5300 > dig.out.ns3 || status=1
+       @10.53.0.3 axfr -p 5300 > dig.out.ns3 || tmp=1
 grep ";" dig.out.ns3
 
-$PERL ../digcomp.pl dig2.good dig.out.ns3 || status=1
+$PERL ../digcomp.pl dig2.good dig.out.ns3 || tmp=1
 
 # ns3 has a journal iff it received an IXFR.
-test -f ns3/example.bk.jnl || status=1 
+test -f ns3/example.bk || tmp=1 
+test -f ns3/example.bk.jnl || tmp=1 
+
+if test $tmp != 0 ; then echo "I:failed"; fi
+status=`expr $status + $tmp`
+
+echo "I:testing ixfr-from-differences master; (master zone)"
+tmp=0
+
+$DIG $DIGOPTS master. \
+       @10.53.0.6 axfr -p 5300 > dig.out.ns6 || tmp=1
+grep ";" dig.out.ns6
+
+$DIG $DIGOPTS master. \
+       @10.53.0.3 axfr -p 5300 > dig.out.ns3 || tmp=1
+grep ";" dig.out.ns3 && cat dig.out.ns3
+
+$PERL ../digcomp.pl dig.out.ns6 dig.out.ns3 || tmp=1
+
+# ns3 has a journal iff it received an IXFR.
+test -f ns3/master.bk || tmp=1 
+test -f ns3/master.bk.jnl || tmp=1 
+
+if test $tmp != 0 ; then echo "I:failed"; fi
+status=`expr $status + $tmp`
+
+echo "I:testing ixfr-from-differences master; (slave zone)"
+tmp=0
+
+$DIG $DIGOPTS slave. \
+       @10.53.0.6 axfr -p 5300 > dig.out.ns6 || tmp=1
+grep ";" dig.out.ns6
+
+$DIG $DIGOPTS slave. \
+       @10.53.0.1 axfr -p 5300 > dig.out.ns1 || tmp=1
+grep ";" dig.out.ns1
+
+$PERL ../digcomp.pl dig.out.ns6 dig.out.ns1 || tmp=1
+
+# ns6 has a journal iff it received an IXFR.
+test -f ns6/slave.bk || tmp=1 
+test -f ns6/slave.bk.jnl && tmp=1 
+
+if test $tmp != 0 ; then echo "I:failed"; fi
+status=`expr $status + $tmp`
+
+echo "I:testing ixfr-from-differences slave; (master zone)"
+tmp=0
+
+# ns7 has a journal iff it generates an IXFR.
+test -f ns7/master2.db || tmp=1 
+test -f ns7/master2.db.jnl && tmp=1 
+
+if test $tmp != 0 ; then echo "I:failed"; fi
+status=`expr $status + $tmp`
+echo "I:testing ixfr-from-differences slave; (slave zone)"
+tmp=0
+
+$DIG $DIGOPTS slave. \
+       @10.53.0.1 axfr -p 5300 > dig.out.ns1 || tmp=1
+grep ";" dig.out.ns1
+
+$DIG $DIGOPTS slave. \
+       @10.53.0.7 axfr -p 5300 > dig.out.ns7 || tmp=1
+grep ";" dig.out.ns1
+
+$PERL ../digcomp.pl dig.out.ns7 dig.out.ns1 || tmp=1
+
+# ns7 has a journal iff it generates an IXFR.
+test -f ns7/slave.bk || tmp=1 
+test -f ns7/slave.bk.jnl || tmp=1 
+
+if test $tmp != 0 ; then echo "I:failed"; fi
+status=`expr $status + $tmp`
 
 echo "I:exit status: $status"
 exit $status