]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
named-checkconf failed to report dnstap-output missing
authorMark Andrews <marka@isc.org>
Fri, 12 Jul 2019 04:28:03 +0000 (14:28 +1000)
committerMark Andrews <marka@isc.org>
Tue, 23 Jul 2019 13:36:40 +0000 (23:36 +1000)
from named.conf when dnstap was specified

(cherry picked from commit a4f38bec6af9cfbd3df235c4fadaac685e491fa0)

CHANGES
bin/tests/system/dnstap/bad-missing-dnstap-output.conf [new file with mode: 0644]
lib/bind9/check.c
util/copyrights

diff --git a/CHANGES b/CHANGES
index 8fde9a4996811fd09c630aa1007ca999041bbe1c..c04818e34d9e9bfbc9dc3b468b31d9e73c6c71ab 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+5266.  [bug]           named-checkconf failed to report dnstap-output
+                       missing from named.conf when dnstap was specified.
+                       [GL #1136]
+
 5264.  [func]          New DNS Cookie algorithm - siphash24 - has been added to
                        BIND 9. [GL #605]
 
diff --git a/bin/tests/system/dnstap/bad-missing-dnstap-output.conf b/bin/tests/system/dnstap/bad-missing-dnstap-output.conf
new file mode 100644 (file)
index 0000000..2cc470b
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * 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.
+ */
+
+options {
+       dnstap { client; auth; };
+       recursion yes;
+};
index d45e732b1cd9ea283eecacef156e5b9a9033636f..faf2040a11b5bd08eb1b7bfd64f60d148dc26a06 100644 (file)
@@ -1487,6 +1487,21 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
                        }
                }
        }
+
+       obj = NULL;
+       (void) cfg_map_get(options, "dnstap", &obj);
+       if (obj != NULL) {
+               const cfg_obj_t *output = NULL;
+               (void) cfg_map_get(options, "dnstap-output", &output);
+               if (output == NULL) {
+                       cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
+                                   "'dnstap-output' must be set if 'dnstap' "
+                                   "is set");
+                       if (result == ISC_R_SUCCESS) {
+                               result = ISC_R_FAILURE;
+                       }
+               }
+       }
 #endif
 
        obj = NULL;
index 31477c1bc9b43cad751f6644ad7a540db74f8cba..cbedfb57a81749b25c7e7246aac39d3ed205fd09 100644 (file)
 ./bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-min.conf     CONF-C  2016,2018,2019
 ./bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-max.conf       CONF-C  2016,2018,2019
 ./bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-min.conf       CONF-C  2016,2018,2019
+./bin/tests/system/dnstap/bad-missing-dnstap-output.conf       CONF-C  2019
 ./bin/tests/system/dnstap/clean.sh             SH      2015,2016,2017,2018,2019
 ./bin/tests/system/dnstap/good-fstrm-set-buffer-hint.conf      CONF-C  2016,2018,2019
 ./bin/tests/system/dnstap/good-fstrm-set-flush-timeout.conf    CONF-C  2016,2018,2019