diff --git a/CHANGES b/CHANGES index 8ef0795d73..2928f56c91 100644 --- 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] diff --git a/bin/tests/system/masterfile/clean.sh b/bin/tests/system/masterfile/clean.sh index 4bca22f43e..b54b3155f6 100644 --- a/bin/tests/system/masterfile/clean.sh +++ b/bin/tests/system/masterfile/clean.sh @@ -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* diff --git a/bin/tests/system/masterfile/tests.sh b/bin/tests/system/masterfile/tests.sh index c4725a10f3..d7f393423b 100644 --- a/bin/tests/system/masterfile/tests.sh +++ b/bin/tests/system/masterfile/tests.sh @@ -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 index 0000000000..efbfb3ce16 --- /dev/null +++ b/bin/tests/system/masterfile/zone/inheritownerafterinclude.db @@ -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 index 0000000000..3877ed5f72 --- /dev/null +++ b/bin/tests/system/masterfile/zone/inheritownerafterinclude.good @@ -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 index 0000000000..f89a3f7b2d --- /dev/null +++ b/bin/tests/system/masterfile/zone/nameservers.db @@ -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 . diff --git a/lib/isc/lex.c b/lib/isc/lex.c index aa3a6c9ffd..f917e93957 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c @@ -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)); diff --git a/util/copyrights b/util/copyrights index 3f0b98f69e..2f6438d88b 100644 --- a/util/copyrights +++ b/util/copyrights @@ -1499,7 +1499,7 @@ ./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 @@ -1508,7 +1508,10 @@ ./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 @@ -3598,7 +3601,7 @@ ./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