]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4100. [bug] Inherited owernames on the line immediately following
authorMark Andrews <marka@isc.org>
Wed, 15 Apr 2015 02:47:57 +0000 (12:47 +1000)
committerMark Andrews <marka@isc.org>
Wed, 15 Apr 2015 02:47:57 +0000 (12:47 +1000)
                        a $INCLUDE were not working.  [RT #39268]

CHANGES
bin/tests/system/masterfile/clean.sh
bin/tests/system/masterfile/tests.sh
bin/tests/system/masterfile/zone/inheritownerafterinclude.db [new file with mode: 0644]
bin/tests/system/masterfile/zone/inheritownerafterinclude.good [new file with mode: 0644]
bin/tests/system/masterfile/zone/nameservers.db [new file with mode: 0644]
lib/isc/lex.c
util/copyrights

diff --git a/CHANGES b/CHANGES
index 8ef0795d73a05f135fb348c91a6b7be55416d496..2928f56c91caedeb77925b4604353f9ee00575ea 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4100.  [bug]           Inherited owernames on the line immediately following
+                       a $INCLUDE were not working.  [RT #39268]
+
 4099.  [port]          clang: make unknown commandline options hard errors
                        when determining what options are supported.
                        [RT #39273]
index 4bca22f43ed569ea011ca2b3331023ea4205ef98..b54b3155f6e09ef1dea41425ff56b53155ee10df 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2004, 2007, 2010, 2012, 2014  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2010, 2012, 2014, 2015  Internet Systems Consortium, Inc. ("ISC")
 # Copyright (C) 2001  Internet Software Consortium.
 #
 # Permission to use, copy, modify, and/or distribute this software for any
@@ -20,3 +20,4 @@
 rm -f dig.out.*
 rm -f */named.memstats
 rm -f ns*/named.lock
+rm -f checkzone.out*
index c4725a10f34a33b0ae8d8bc21d638a15c16674b9..d7f393423bdc84ae54ef67105ca5c4d4d26bd691 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2004, 2007, 2010, 2012  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2010, 2012, 2015  Internet Systems Consortium, Inc. ("ISC")
 # Copyright (C) 2001  Internet Software Consortium.
 #
 # Permission to use, copy, modify, and/or distribute this software for any
@@ -54,5 +54,13 @@ grep "status: SERVFAIL" dig.out.$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+ret=0
+n=`expr $n + 1`
+echo "I:test owner inheritence after "'$INCLUDE'" ($n)"
+$CHECKZONE -Dq example zone/inheritownerafterinclude.db > checkzone.out$n
+diff checkzone.out$n zone/inheritownerafterinclude.good || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status
diff --git a/bin/tests/system/masterfile/zone/inheritownerafterinclude.db b/bin/tests/system/masterfile/zone/inheritownerafterinclude.db
new file mode 100644 (file)
index 0000000..efbfb3c
--- /dev/null
@@ -0,0 +1,17 @@
+; Copyright (C) 2015  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.
+
+@ 0    IN      SOA     . . 0 0 0 0 0
+$INCLUDE zone/nameservers.db
+       IN      TXT     "this should be at the zone apex"
diff --git a/bin/tests/system/masterfile/zone/inheritownerafterinclude.good b/bin/tests/system/masterfile/zone/inheritownerafterinclude.good
new file mode 100644 (file)
index 0000000..3877ed5
--- /dev/null
@@ -0,0 +1,3 @@
+example.                                     0 IN SOA          . . 0 0 0 0 0
+example.                                     0 IN NS           .
+example.                                     0 IN TXT          "this should be at the zone apex"
diff --git a/bin/tests/system/masterfile/zone/nameservers.db b/bin/tests/system/masterfile/zone/nameservers.db
new file mode 100644 (file)
index 0000000..f89a3f7
--- /dev/null
@@ -0,0 +1,15 @@
+; Copyright (C) 2015  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.
+
+@      IN      NS      .
index aa3a6c9ffd59476a1df0b67cec1c007da5133246..f917e9395769dc322aa333689e83cd3e2ca02a5a 100644 (file)
@@ -41,6 +41,7 @@ typedef struct inputsource {
        isc_boolean_t                   is_file;
        isc_boolean_t                   need_close;
        isc_boolean_t                   at_eof;
+       isc_boolean_t                   last_was_eol;
        isc_buffer_t *                  pushback;
        unsigned int                    ignored;
        void *                          input;
@@ -202,6 +203,7 @@ new_source(isc_lex_t *lex, isc_boolean_t is_file, isc_boolean_t need_close,
        source->is_file = is_file;
        source->need_close = need_close;
        source->at_eof = ISC_FALSE;
+       source->last_was_eol = lex->last_was_eol;
        source->input = input;
        source->name = isc_mem_strdup(lex->mctx, name);
        if (source->name == NULL) {
@@ -289,6 +291,7 @@ isc_lex_close(isc_lex_t *lex) {
                return (ISC_R_NOMORE);
 
        ISC_LIST_UNLINK(lex->sources, source, link);
+       lex->last_was_eol = source->last_was_eol;
        if (source->is_file) {
                if (source->need_close)
                        (void)fclose((FILE *)(source->input));
index 3f0b98f69ec83b348dec1c63b87ba60c33ab3383..2f6438d88b3e44bd4d4056685529185dcc0fbf09 100644 (file)
 ./bin/tests/system/lwresd/ns1/root.db          ZONE    2000,2001,2004,2007
 ./bin/tests/system/lwresd/resolv.conf          CONF-SH 2000,2001,2004,2007,2012
 ./bin/tests/system/lwresd/tests.sh             SH      2000,2001,2004,2007,2011,2012,2013,2014
-./bin/tests/system/masterfile/clean.sh         SH      2001,2004,2007,2010,2012,2014
+./bin/tests/system/masterfile/clean.sh         SH      2001,2004,2007,2010,2012,2014,2015
 ./bin/tests/system/masterfile/knowngood.dig.out        X       2001,2004,2012
 ./bin/tests/system/masterfile/ns1/include.db   ZONE    2001,2004,2007,2012
 ./bin/tests/system/masterfile/ns1/named.conf   CONF-C  2001,2004,2007
 ./bin/tests/system/masterfile/ns1/ttl2.db      ZONE    2001,2004,2007
 ./bin/tests/system/masterfile/ns2/example.db   ZONE    2010
 ./bin/tests/system/masterfile/ns2/named.conf   CONF-C  2010
-./bin/tests/system/masterfile/tests.sh         SH      2001,2004,2007,2010,2012
+./bin/tests/system/masterfile/tests.sh         SH      2001,2004,2007,2010,2012,2015
+./bin/tests/system/masterfile/zone/inheritownerafterinclude.db ZONE    2015
+./bin/tests/system/masterfile/zone/inheritownerafterinclude.good       X       2015
+./bin/tests/system/masterfile/zone/nameservers.db      ZONE    2015
 ./bin/tests/system/masterformat/clean.sh       SH      2005,2007,2011,2012,2013,2014
 ./bin/tests/system/masterformat/ns1/compile.sh SH      2005,2006,2007,2011,2012,2013,2014
 ./bin/tests/system/masterformat/ns1/example.db ZONE    2005,2007,2014
 ./lib/isc/inet_ntop.c                          C       1996,1997,1998,1999,2000,2001,2004,2005,2007,2009
 ./lib/isc/inet_pton.c                          C       1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2007,2013,2014
 ./lib/isc/iterated_hash.c                      C       2006,2008,2009
-./lib/isc/lex.c                                        C       1998,1999,2000,2001,2002,2003,2004,2005,2007,2013,2014
+./lib/isc/lex.c                                        C       1998,1999,2000,2001,2002,2003,2004,2005,2007,2013,2014,2015
 ./lib/isc/lfsr.c                               C       1999,2000,2001,2002,2004,2005,2007
 ./lib/isc/lib.c                                        C       1999,2000,2001,2004,2005,2007,2009,2013,2014
 ./lib/isc/log.c                                        C       1999,2000,2001,2002,2003,2004,2005,2006,2007,2009,2011,2012,2013,2014