]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3375. [bug] 'rndc dumpdb' failed on empty caches. [RT #30808]
authorMark Andrews <marka@isc.org>
Thu, 13 Sep 2012 21:53:19 +0000 (07:53 +1000)
committerMark Andrews <marka@isc.org>
Thu, 13 Sep 2012 21:53:19 +0000 (07:53 +1000)
CHANGES
bin/tests/system/rndc/clean.sh
bin/tests/system/rndc/ns3/named.conf [new file with mode: 0644]
bin/tests/system/rndc/tests.sh
lib/dns/masterdump.c

diff --git a/CHANGES b/CHANGES
index c241ce0129400e8154720dc9c27811dd56119d61..1275563dc83383c2c2a3f7ab97f0e27e0974d6b5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3375.  [bug]           'rndc dumpdb' failed on empty caches. [RT #30808]
+
 3374.   [bug]           isc_parse_uint32 failed to return a range error on 
                         systems with 64 bit longs [RT #30232]   
 
index 425f9946ea41009b4286a88999d9f0efeb7ba702..2fcfcfb04d60b9dc126f23755464967a42582b7f 100644 (file)
@@ -18,4 +18,7 @@
 
 rm -f ns2/*.db ns2/*.jnl
 rm -f ns2/session.key
-rm -f ns2/named.memstats
+rm -f ns2/named.stats
+rm -f ns3/named_dump.db
+rm -f ns*/named.memstats
+rm -f ns*/named.run
diff --git a/bin/tests/system/rndc/ns3/named.conf b/bin/tests/system/rndc/ns3/named.conf
new file mode 100644 (file)
index 0000000..d50a7f9
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012  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.
+ */
+
+controls { /* empty */ };
+
+options {
+       port 5300;
+       pid-file "named.pid";
+       listen-on { 10.53.0.3; };
+       listen-on-v6 { none; };
+        recursion no;
+};
+
+key rndc_key {
+       secret "1234abcd8765";
+       algorithm hmac-md5;
+};
+
+key secondkey {
+       secret "abcd1234abcd8765";
+       algorithm hmac-md5;
+};
+
+controls {
+       inet 10.53.0.3 port 9953 allow { any; } keys { rndc_key; secondkey; };
+};
+
+
+zone "." {
+       type hint;
+       file "../../common/root.hint";
+};
index 4b1873b4659bc05232fdeb9bf6bc0a1029de30d6..584dbb896eb9e4b9d181a4c94644083988ff9d0a 100644 (file)
@@ -239,5 +239,19 @@ $RNDC -s 10.53.0.2 -p 9953 -c ns2/secondkey.conf status > /dev/null || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:test 'rndc dumpdb' on a empty cache"
+ret=0
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf dumpdb > /dev/null || ret=1
+for i in 1 2 3 4 5  6 7 8 9
+do
+       tmp=0
+       grep "Dump complete" ns3/named_dump.db > /dev/null || tmp=1
+       [ $tmp -eq 0 ] && break
+       sleep 1
+done
+[ $tmp -eq 1 ] && ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status
index 42ba1f5fa40bca9945035294dc4411e559250c2e..e66b34dc227154c1f723743095ee4468cc8520e9 100644 (file)
@@ -1492,7 +1492,7 @@ dumptostreaminc(dns_dumpctx_t *dctx) {
                }
 
                result = dns_dbiterator_first(dctx->dbiter);
-               if (result != ISC_R_SUCCESS)
+               if (result != ISC_R_SUCCESS && result != ISC_R_NOMORE)
                        goto cleanup;
 
                dctx->first = ISC_FALSE;