]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Report duplicate dnssec-policy names
authorMark Andrews <marka@isc.org>
Thu, 23 Dec 2021 06:54:53 +0000 (17:54 +1100)
committerEvan Hunt <each@isc.org>
Mon, 3 Jan 2022 19:48:26 +0000 (11:48 -0800)
Duplicate dnssec-policy names were detected as an error condition
but were not logged.

bin/tests/system/checkconf/bad-kasp-duplicate.conf [new file with mode: 0644]
lib/isccfg/kaspconf.c

diff --git a/bin/tests/system/checkconf/bad-kasp-duplicate.conf b/bin/tests/system/checkconf/bad-kasp-duplicate.conf
new file mode 100644 (file)
index 0000000..8ecc670
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * 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.
+ */
+
+dnssec-policy a { };
+dnssec-policy a { };
index b790c9a8d3f78c33b233a98256c243cb40b5e85b..4d8653478f64197aa216f360c5f4963dd8f82133 100644 (file)
@@ -272,6 +272,10 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, const char *name, isc_mem_t *mctx,
        result = dns_kasplist_find(kasplist, kaspname, &kasp);
 
        if (result == ISC_R_SUCCESS) {
+               cfg_obj_log(
+                       config, logctx, ISC_LOG_ERROR,
+                       "dnssec-policy: duplicately named policy found '%s'",
+                       kaspname);
                dns_kasp_detach(&kasp);
                return (ISC_R_EXISTS);
        }