]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3283. [bug] Raw zones with with more than 512 records in a RRset
authorMark Andrews <marka@isc.org>
Tue, 14 Feb 2012 00:14:28 +0000 (00:14 +0000)
committerMark Andrews <marka@isc.org>
Tue, 14 Feb 2012 00:14:28 +0000 (00:14 +0000)
                        failed to load. [RT #27863]

CHANGES
bin/tests/system/masterformat/clean.sh
bin/tests/system/masterformat/ns1/compile.sh
bin/tests/system/masterformat/ns1/large.db.in [new file with mode: 0644]
bin/tests/system/masterformat/ns1/named.conf
bin/tests/system/masterformat/ns2/named.conf
bin/tests/system/masterformat/tests.sh
lib/dns/master.c

diff --git a/CHANGES b/CHANGES
index 48a484de73943a9d4f989bd0ce1fda97029614b9..5baeac86d12b6d4359673cf8fdb52c6a89af5ffc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3283.  [bug]           Raw zones with with more than 512 records in a RRset
+                       failed to load. [RT #27863]
+
 3282.  [bug]           Restrict the TTL of NS RRset to no more than that
                        of the old NS RRset when replacing it. [RT #27792]
 
index 1909dc2ed3bda19872e873f02fe32d7779c2c3a2..50fcf4f05fac836d274e855461b0485a86960a50 100755 (executable)
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: clean.sh,v 1.5 2007/09/26 03:22:44 marka Exp $
+# $Id: clean.sh,v 1.5.476.1 2012/02/14 00:14:27 marka Exp $
 
 rm -f named-compilezone
 rm -f ns1/example.db.raw
-rm -f ns2/example.db
+rm -f ns1/large.db ns1/large.db.raw
 rm -f dig.out.*
+rm -f dig.out
 rm -f */named.memstats
+rm -f ns2/example.db
+rm -f ns2/large.bk
index 551a01f0bd6399672d7adc2446e00c2d8775791b..0fb0b98d0bec01363e3b5ee4bcb80db4e2ae972f 100755 (executable)
@@ -12,6 +12,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: compile.sh,v 1.6 2007/06/19 23:47:04 tbox Exp $
+# $Id: compile.sh,v 1.6.558.1 2012/02/14 00:14:27 marka Exp $
 
 ../named-compilezone -D -F raw -o example.db.raw example example.db
+../named-compilezone -D -F raw -o large.db.raw large large.db > /dev/null 2>&1
diff --git a/bin/tests/system/masterformat/ns1/large.db.in b/bin/tests/system/masterformat/ns1/large.db.in
new file mode 100644 (file)
index 0000000..8499937
--- /dev/null
@@ -0,0 +1,27 @@
+; Copyright (C) 2005, 2007  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: large.db.in,v 1.2.6.2 2012/02/14 00:14:28 marka Exp $
+
+$TTL 1D
+
+@                      IN SOA  ns hostmaster (
+                               1
+                               3600
+                               1800
+                               1814400
+                               3
+                               )
+                       NS      ns
+ns                     A       10.53.0.1
index a2971f5c1deaef3a377b724225fa6b0612056dfa..a740fab2d55a1217470ed1124398bf79d8a711bc 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.4 2007/06/19 23:47:04 tbox Exp $ */
+/* $Id: named.conf,v 1.4.558.1 2012/02/14 00:14:28 marka Exp $ */
 
 // NS1
 
@@ -34,3 +34,10 @@ zone "example" {
        masterfile-format raw;
        file "example.db.raw";
 };
+
+zone "large" {
+        type master;
+        file "large.db.raw";
+       masterfile-format raw;
+        allow-transfer { any; };
+};
index 3cda00e4e949298440b0839768b339c42ffb6292..6584b1c887cbb3d7ee289e332badf313ade697ba 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.4 2007/06/19 23:47:04 tbox Exp $ */
+/* $Id: named.conf,v 1.4.558.1 2012/02/14 00:14:28 marka Exp $ */
 
 // NS2
 
@@ -33,3 +33,10 @@ zone "example" {
        type master;
        file "example.db";
 };
+
+zone "large" {
+        type slave;
+        masters { 10.53.0.1; };
+        masterfile-format raw;
+        file "large.bk";
+};
index 71c115d21ee23bc232c604ff19b9d8416844c693..73407a888f3ebbd0da9a31fc06195e7d50bacb63 100755 (executable)
@@ -14,7 +14,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.4 2007/06/19 23:47:04 tbox Exp $
+# $Id: tests.sh,v 1.4.558.1 2012/02/14 00:14:27 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -54,7 +54,7 @@ exit $status
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.4 2007/06/19 23:47:04 tbox Exp $
+# $Id: tests.sh,v 1.4.558.1 2012/02/14 00:14:27 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -76,5 +76,15 @@ done
 
 diff dig.out.1 dig.out.2 || status=1
 
+echo "I:checking that large rdatasets loaded"
+ret=0
+for a in a b c
+do
+       $DIG +tcp txt ${a}.large @10.53.0.2 -p 5300 > dig.out
+       grep "status: NOERROR" dig.out > /dev/null || ret=1
+done
+[ $ret -eq 0 ] || echo "I:failed"
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status
index 71eef9e95453fb1a9a0dcf13ad6753896ef9281d..0e17ce4bbdabde5582eb27520fd3200ef5521eff 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: master.c,v 1.178.104.2 2011/03/12 04:58:27 tbox Exp $ */
+/* $Id: master.c,v 1.178.104.3 2012/02/14 00:14:28 marka Exp $ */
 
 /*! \file */
 
@@ -2257,14 +2257,14 @@ load_raw(dns_loadctx_t *lctx) {
                if (rdcount > rdata_size) {
                        dns_rdata_t *new_rdata = NULL;
 
-                       new_rdata = grow_rdata(rdata_size + RDSZ, rdata,
+                       new_rdata = grow_rdata(rdcount + RDSZ, rdata,
                                               rdata_size, &head,
                                               &dummy, mctx);
                        if (new_rdata == NULL) {
                                result = ISC_R_NOMEMORY;
                                goto cleanup;
                        }
-                       rdata_size += RDSZ;
+                       rdata_size = rdcount + RDSZ;
                        rdata = new_rdata;
                }
 
@@ -2687,6 +2687,7 @@ grow_rdatalist(int new_len, dns_rdatalist_t *old, int old_len,
        }
        while ((this = ISC_LIST_HEAD(save)) != NULL) {
                ISC_LIST_UNLINK(save, this, link);
+               INSIST(rdlcount < new_len);
                new[rdlcount] = *this;
                ISC_LIST_APPEND(*current, &new[rdlcount], link);
                rdlcount++;
@@ -2699,6 +2700,7 @@ grow_rdatalist(int new_len, dns_rdatalist_t *old, int old_len,
        }
        while ((this = ISC_LIST_HEAD(save)) != NULL) {
                ISC_LIST_UNLINK(save, this, link);
+               INSIST(rdlcount < new_len);
                new[rdlcount] = *this;
                ISC_LIST_APPEND(*glue, &new[rdlcount], link);
                rdlcount++;
@@ -2742,6 +2744,7 @@ grow_rdata(int new_len, dns_rdata_t *old, int old_len,
                }
                while ((rdata = ISC_LIST_HEAD(save)) != NULL) {
                        ISC_LIST_UNLINK(save, rdata, link);
+                       INSIST(rdcount < new_len);
                        new[rdcount] = *rdata;
                        ISC_LIST_APPEND(this->rdata, &new[rdcount], link);
                        rdcount++;
@@ -2761,13 +2764,14 @@ grow_rdata(int new_len, dns_rdata_t *old, int old_len,
                }
                while ((rdata = ISC_LIST_HEAD(save)) != NULL) {
                        ISC_LIST_UNLINK(save, rdata, link);
+                       INSIST(rdcount < new_len);
                        new[rdcount] = *rdata;
                        ISC_LIST_APPEND(this->rdata, &new[rdcount], link);
                        rdcount++;
                }
                this = ISC_LIST_NEXT(this, link);
        }
-       INSIST(rdcount == old_len);
+       INSIST(rdcount == old_len || rdcount == 0);
        if (old != NULL)
                isc_mem_put(mctx, old, old_len * sizeof(*old));
        return (new);