From ff4855d358232640a8d2055c32499fa63ebf5fbc Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 17 Jun 2019 17:11:00 -0700 Subject: [PATCH 1/4] allow glue in authoritative responses to root priming queries - when processing authoritative queries for ./NS, set 'gluedb' so that glue will be included in the response, regardless of how 'minimal-responses' has been configured. (cherry picked from commit e7684c7b640c838308e43911477ace171db1597a) --- bin/named/query.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/named/query.c b/bin/named/query.c index b34d7e8fb5..2a54144d8a 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -9028,11 +9028,13 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) } /* - * BIND 8 priming queries need the additional section. + * Always add glue for root priming queries, regardless + * of "minimal-responses" setting. */ if (dns_name_equal(client->query.qname, dns_rootname)) { client->query.attributes &= ~NS_QUERYATTR_NOADDITIONAL; + dns_db_attach(db, &client->query.gluedb); } } @@ -9184,6 +9186,10 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) free_devent(client, ISC_EVENT_PTR(&event), &event); } + if (client->query.gluedb != NULL) { + dns_db_detach(&client->query.gluedb); + } + /* * AA bit. */ From 2fd9e88405fcd3e75a6ed717b4a476a136de6e87 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 17 Jun 2019 19:12:02 -0700 Subject: [PATCH 2/4] add system test to confirm glue is returned in priming queries (cherry picked from commit 9a1f0ea873624b1ffd0891717401c386fec2749f) --- .../system/additional/ns1/named1.conf.in | 5 +++ .../system/additional/ns1/named2.conf.in | 5 +++ .../system/additional/ns1/named3.conf.in | 5 +++ .../system/additional/ns1/named4.conf.in | 5 +++ bin/tests/system/additional/ns1/root.db | 19 +++++++++++ bin/tests/system/additional/tests.sh | 32 +++++++++++++++++++ 6 files changed, 71 insertions(+) create mode 100644 bin/tests/system/additional/ns1/root.db diff --git a/bin/tests/system/additional/ns1/named1.conf.in b/bin/tests/system/additional/ns1/named1.conf.in index dcaf81cb41..2274082de1 100644 --- a/bin/tests/system/additional/ns1/named1.conf.in +++ b/bin/tests/system/additional/ns1/named1.conf.in @@ -29,6 +29,11 @@ controls { inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; +zone "." { + type master; + file "root.db"; +}; + zone "rt.example" { type master; file "rt.db"; diff --git a/bin/tests/system/additional/ns1/named2.conf.in b/bin/tests/system/additional/ns1/named2.conf.in index cd0a15efdb..721c5aa08c 100644 --- a/bin/tests/system/additional/ns1/named2.conf.in +++ b/bin/tests/system/additional/ns1/named2.conf.in @@ -29,6 +29,11 @@ controls { inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; +zone "." { + type master; + file "root.db"; +}; + zone "rt.example" { type master; file "rt.db"; diff --git a/bin/tests/system/additional/ns1/named3.conf.in b/bin/tests/system/additional/ns1/named3.conf.in index 8b5248b4d3..87594a98d9 100644 --- a/bin/tests/system/additional/ns1/named3.conf.in +++ b/bin/tests/system/additional/ns1/named3.conf.in @@ -30,6 +30,11 @@ controls { inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; +zone "." { + type master; + file "root.db"; +}; + zone "rt.example" { type master; file "rt.db"; diff --git a/bin/tests/system/additional/ns1/named4.conf.in b/bin/tests/system/additional/ns1/named4.conf.in index eb503febc7..7845a4c9a6 100644 --- a/bin/tests/system/additional/ns1/named4.conf.in +++ b/bin/tests/system/additional/ns1/named4.conf.in @@ -29,6 +29,11 @@ controls { inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; +zone "." { + type master; + file "root.db"; +}; + zone "mx.example" { type master; file "mx.db"; diff --git a/bin/tests/system/additional/ns1/root.db b/bin/tests/system/additional/ns1/root.db new file mode 100644 index 0000000000..7db363b2bf --- /dev/null +++ b/bin/tests/system/additional/ns1/root.db @@ -0,0 +1,19 @@ +; Copyright (C) Internet Systems Consortium, Inc. ("ISC") +; +; This Source Code Form is subject to the terms of the Mozilla Public +; License, v. 2.0. If a copy of the MPL was not distributed with this +; file, You can obtain one at http://mozilla.org/MPL/2.0/. +; +; See the COPYRIGHT file distributed with this work for additional +; information regarding copyright ownership. + +. IN SOA ns2. hostmaster ( 2 8H 2H 4W 1D); +. NS ns1.rt.example. +. NS ns2.rt.example. +ns1.rt.example. A 10.53.0.1 +ns2.rt.example. A 10.53.0.2 +rt.example. NS ns1. +naptr.example. NS ns1. +rt2.example. NS ns1. +naptr2.example. NS ns1. +nid.example. NS ns1. diff --git a/bin/tests/system/additional/tests.sh b/bin/tests/system/additional/tests.sh index 692af541ff..dc537ccf99 100644 --- a/bin/tests/system/additional/tests.sh +++ b/bin/tests/system/additional/tests.sh @@ -210,6 +210,38 @@ dotests() { if [ $ret -eq 1 ] ; then echo_i " failed"; status=1 fi + + n=`expr $n + 1` + echo_i "test with NS, root zone ($n)" + ret=0 + $DIG $DIGOPTS -t NS . @10.53.0.1 > dig.out.$n || ret=1 + # Always expect glue for root priming queries, regardless $minimal + grep 'ADDITIONAL: 3' dig.out.$n > /dev/null || ret=1 + if [ $ret -eq 1 ] ; then + echo_i " failed"; status=1 + fi + + n=`expr $n + 1` + echo_i "test with NS, non-root zone ($n)" + ret=0 + $DIG $DIGOPTS -t NS rt.example @10.53.0.1 > dig.out.$n || ret=1 + case $minimal in + yes) + grep 'ADDITIONAL: 1' dig.out.$n > /dev/null || ret=1 + ;; + no) + grep 'ADDITIONAL: 2' dig.out.$n > /dev/null || ret=1 + ;; + no-auth) + grep 'ADDITIONAL: 2' dig.out.$n > /dev/null || ret=1 + ;; + no-auth-recursive) + grep 'ADDITIONAL: 2' dig.out.$n > /dev/null || ret=1 + ;; + esac + if [ $ret -eq 1 ] ; then + echo_i " failed"; status=1 + fi } echo_i "testing with 'minimal-responses yes;'" From f608f9335da78285e0caeceb3c32f2974f9c666f Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 26 Jun 2019 09:38:50 -0700 Subject: [PATCH 3/4] x --- bin/tests/system/additional/ns1/named1.conf.in | 4 ++-- bin/tests/system/additional/ns1/named2.conf.in | 4 ++-- bin/tests/system/additional/ns1/named3.conf.in | 4 ++-- bin/tests/system/additional/ns1/named4.conf.in | 4 ++-- util/copyrights | 1 + 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/tests/system/additional/ns1/named1.conf.in b/bin/tests/system/additional/ns1/named1.conf.in index 2274082de1..ad0079704e 100644 --- a/bin/tests/system/additional/ns1/named1.conf.in +++ b/bin/tests/system/additional/ns1/named1.conf.in @@ -30,8 +30,8 @@ controls { }; zone "." { - type master; - file "root.db"; + type master; + file "root.db"; }; zone "rt.example" { diff --git a/bin/tests/system/additional/ns1/named2.conf.in b/bin/tests/system/additional/ns1/named2.conf.in index 721c5aa08c..30a19b13a5 100644 --- a/bin/tests/system/additional/ns1/named2.conf.in +++ b/bin/tests/system/additional/ns1/named2.conf.in @@ -30,8 +30,8 @@ controls { }; zone "." { - type master; - file "root.db"; + type master; + file "root.db"; }; zone "rt.example" { diff --git a/bin/tests/system/additional/ns1/named3.conf.in b/bin/tests/system/additional/ns1/named3.conf.in index 87594a98d9..fe442b1db4 100644 --- a/bin/tests/system/additional/ns1/named3.conf.in +++ b/bin/tests/system/additional/ns1/named3.conf.in @@ -31,8 +31,8 @@ controls { }; zone "." { - type master; - file "root.db"; + type master; + file "root.db"; }; zone "rt.example" { diff --git a/bin/tests/system/additional/ns1/named4.conf.in b/bin/tests/system/additional/ns1/named4.conf.in index 7845a4c9a6..221566986b 100644 --- a/bin/tests/system/additional/ns1/named4.conf.in +++ b/bin/tests/system/additional/ns1/named4.conf.in @@ -30,8 +30,8 @@ controls { }; zone "." { - type master; - file "root.db"; + type master; + file "root.db"; }; zone "mx.example" { diff --git a/util/copyrights b/util/copyrights index ab830bf96c..10ba42a469 100644 --- a/util/copyrights +++ b/util/copyrights @@ -524,6 +524,7 @@ ./bin/tests/system/additional/ns1/naptr.db ZONE 2013,2016,2018,2019 ./bin/tests/system/additional/ns1/naptr2.db ZONE 2013,2016,2018,2019 ./bin/tests/system/additional/ns1/nid.db ZONE 2013,2016,2018,2019 +./bin/tests/system/additional/ns1/root.db ZONE 2019 ./bin/tests/system/additional/ns1/rt.db ZONE 2013,2016,2018,2019 ./bin/tests/system/additional/ns1/rt2.db ZONE 2013,2016,2018,2019 ./bin/tests/system/additional/ns1/srv.db ZONE 2016,2018,2019 From 7cbb5897959be0fbdbb3bf33837e61c86111d5dd Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 17 Jun 2019 19:13:59 -0700 Subject: [PATCH 4/4] CHANGES, release note (cherry picked from commit 03a6a78b553e5ee569650188ddf4fb2851e53acc) --- CHANGES | 4 ++++ doc/arm/notes.xml | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index 800d3124fb..86e5d490cc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5256. [bug] Ensure that glue records are included in root + priming responses if "minimal-responses" is not + set to "yes". [GL #1092] + 5255. [bug] Errors encountered while reloading inline-signing zones could be ignored, causing the zone content to be left in an incompletely updated state rather than diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml index cd0aa85704..0b4400c2fb 100644 --- a/doc/arm/notes.xml +++ b/doc/arm/notes.xml @@ -81,6 +81,17 @@ +
Bug Fixes + + + + Glue address records were not being returned in responses + to root priming queries; this has been corrected. [GL #1092] + + + +
+
End of Life BIND 9.11 (Extended Support Version) will be supported until at