Commit 775234ed16 for bind
commit 775234ed16567a743e4f762c649848175ce1ef64
Author: Evan Hunt <each@isc.org>
Date: Thu Oct 22 18:43:17 2026 -0700
correctly silence "type redirect" deprecation warning
named-checkconf -i should silence warning messages about
deprecated options, but the messages about "type redirect"
zones were still printed.
diff --git a/bin/check/named-checkconf.c b/bin/check/named-checkconf.c
index 53dbbe0557..bb4d8a606d 100644
--- a/bin/check/named-checkconf.c
+++ b/bin/check/named-checkconf.c
@@ -575,7 +575,8 @@ main(int argc, char **argv) {
bool builtin = false;
unsigned int flags = 0;
unsigned int parserflags = 0;
- unsigned int checkflags = BIND_CHECK_PLUGINS | BIND_CHECK_ALGORITHMS;
+ unsigned int checkflags = BIND_CHECK_PLUGINS | BIND_CHECK_ALGORITHMS |
+ BIND_CHECK_DEPRECATED;
isc_commandline_init(argc, argv);
@@ -628,6 +629,7 @@ main(int argc, char **argv) {
case 'i':
parserflags |= CFG_PCTX_NODEPRECATED;
+ checkflags &= ~BIND_CHECK_DEPRECATED;
break;
case 'j':
diff --git a/bin/named/config.c b/bin/named/config.c
index 13300a4f47..cba8e25fd9 100644
--- a/bin/named/config.c
+++ b/bin/named/config.c
@@ -82,7 +82,9 @@ named_config_parsefile(cfg_obj_t **conf) {
* checked later when the modules are actually loaded and
* registered.)
*/
- CHECK(isccfg_check_namedconf(*conf, BIND_CHECK_ALGORITHMS, isc_g_mctx));
+ CHECK(isccfg_check_namedconf(
+ *conf, BIND_CHECK_ALGORITHMS | BIND_CHECK_DEPRECATED,
+ isc_g_mctx));
goto out;
diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh
index 66bcd50186..0f40d367f0 100644
--- a/bin/tests/system/checkconf/tests.sh
+++ b/bin/tests/system/checkconf/tests.sh
@@ -194,11 +194,9 @@ $CHECKCONF deprecated.conf >checkconf.out$n.1 2>&1 || ret=1
grep "option 'max-zone-ttl' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
grep "option 'nxdomain-redirect' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
grep "type 'redirect' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
-if [ $ret -ne 0 ]; then echo_i "failed"; fi
-status=$((status + ret))
# set -i to ignore deprecate warnings
$CHECKCONF -i deprecated.conf >checkconf.out$n.2 2>&1
-grep '^.+$' <checkconf.out$n.2 >/dev/null && ret=1
+[ -s checkconf.out$n.2 ] && ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -208,12 +206,12 @@ if ! $FEATURETEST --enable-dnstap; then
ret=0
$CHECKCONF disabled.conf >checkconf.out$n.1 2>&1 && ret=1
grep "option 'dnstap-version' was not enabled at compile time" <checkconf.out$n.1 >/dev/null || ret=1
+ # set -n to ignore disabled warnings
+ $CHECKCONF -n disabled.conf >checkconf.out$n.2 2>&1
+ [ -s checkconf.out$n.2 ] && ret=1
+ if [ $ret -ne 0 ]; then echo_i "failed"; fi
+ status=$((status + ret))
fi
-# set -n to ignore disabled warnings
-$CHECKCONF -n disabled.conf >checkconf.out$n.2 2>&1
-[ -s checkconf.out$n.2 ] && ret=1
-if [ $ret -ne 0 ]; then echo_i "failed"; fi
-status=$((status + ret))
n=$((n + 1))
echo_i "checking named-checkconf servestale warnings ($n)"
diff --git a/lib/isccfg/check.c b/lib/isccfg/check.c
index d13e8d92e1..1d123ad569 100644
--- a/lib/isccfg/check.c
+++ b/lib/isccfg/check.c
@@ -3489,9 +3489,12 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
} else if (strcasecmp(typestr, "hint") == 0) {
ztype = CFG_ZONE_HINT;
} else if (strcasecmp(typestr, "redirect") == 0) {
- cfg_obj_log(obj, ISC_LOG_WARNING,
- "zone '%s': type 'redirect' is deprecated",
- znamestr);
+ if ((flags & BIND_CHECK_DEPRECATED) != 0) {
+ cfg_obj_log(obj, ISC_LOG_WARNING,
+ "zone '%s': type 'redirect' "
+ "is deprecated",
+ znamestr);
+ }
ztype = CFG_ZONE_REDIRECT;
} else {
cfg_obj_log(obj, ISC_LOG_ERROR,
diff --git a/lib/isccfg/include/isccfg/check.h b/lib/isccfg/include/isccfg/check.h
index caa83c49cc..ec40bb9bdb 100644
--- a/lib/isccfg/include/isccfg/check.h
+++ b/lib/isccfg/include/isccfg/check.h
@@ -32,20 +32,17 @@
#define MAX_MAX_NCACHE_TTL 7 * 24 * 3600
#endif /* MAX_MAX_NCACHE_TTL */
-#define BIND_CHECK_PLUGINS 0x00000001
-/*%<
- * Check the plugin configuration.
- */
-#define BIND_CHECK_ALGORITHMS 0x00000002
-/*%<
- * Check the dnssec-policy DNSSEC algorithms against those
- * supported by the crypto provider.
- */
-#define BIND_CHECK_KEYS 0x00000004
-/*%<
- * Check the dnssec-policy DNSSEC keys against the key files
- * in the key stores.
- */
+enum {
+ BIND_CHECK_PLUGINS = 1 << 0, /* Check the plugin configuration */
+ BIND_CHECK_ALGORITHMS = 1 << 1, /* Check the dnssec-policy DNSSEC
+ * algorithms against those supported
+ * by the crypto provider. */
+ BIND_CHECK_KEYS = 1 << 2, /* Check the dnssec-policy DNSSEC keys
+ * against the key files in the key
+ * stores. */
+ BIND_CHECK_DEPRECATED = 1 << 3, /* Check for deprecated parameters
+ * to options */
+};
isc_result_t
isccfg_check_namedconf(const cfg_obj_t *config, unsigned int flags,