]> 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)
committerMark Andrews <marka@isc.org>
Mon, 3 Jan 2022 22:04:07 +0000 (09:04 +1100)
Duplicate dnssec-policy names were detected as an error condition
but were not logged.

(cherry picked from commit b8845454c8c67c5c5650e597936f6303708bdd7d)

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 15433d9f903031763bce76a415762cff030d5adb..f6f1bc3a10e80509d33123170d26c3d84242696f 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);
        }