From: Mark Andrews Date: Thu, 23 Dec 2021 06:54:53 +0000 (+1100) Subject: Report duplicate dnssec-policy names X-Git-Tag: v9.17.22~17^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8845454c8c67c5c5650e597936f6303708bdd7d;p=thirdparty%2Fbind9.git Report duplicate dnssec-policy names Duplicate dnssec-policy names were detected as an error condition but were not logged. --- diff --git a/bin/tests/system/checkconf/bad-kasp-duplicate.conf b/bin/tests/system/checkconf/bad-kasp-duplicate.conf new file mode 100644 index 00000000000..8ecc670e0bc --- /dev/null +++ b/bin/tests/system/checkconf/bad-kasp-duplicate.conf @@ -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 { }; diff --git a/lib/isccfg/kaspconf.c b/lib/isccfg/kaspconf.c index b790c9a8d3f..4d8653478f6 100644 --- a/lib/isccfg/kaspconf.c +++ b/lib/isccfg/kaspconf.c @@ -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); }