]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
simplify "dnssec-validation" configuration
authorEvan Hunt <each@isc.org>
Wed, 29 Oct 2025 01:34:55 +0000 (18:34 -0700)
committerEvan Hunt <each@isc.org>
Wed, 29 Oct 2025 18:28:12 +0000 (18:28 +0000)
In the past, "dnssec-validation" was not looked up in the global
defaults unless "dnssec-enable" was true. "dnssec-enable" has been
obsolete for several years, but dnssec-validation was still being
configured in two steps.  This commit removes the vestigial bits of
the old logic.

bin/named/server.c

index c3dca714b211594f90dfe5ad31ca3c6bbb0361b4..1f1fdc8876731183b4526719245646db8f9af7f8 100644 (file)
@@ -4231,27 +4231,17 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
        view->acceptexpired = cfg_obj_asboolean(obj);
 
        obj = NULL;
-       /* 'optionmaps', not 'maps': don't check named_g_defaultoptions yet */
-       (void)named_config_get(optionmaps, "dnssec-validation", &obj);
-       if (obj == NULL) {
+       result = named_config_get(maps, "dnssec-validation", &obj);
+       INSIST(result == ISC_R_SUCCESS);
+       if (cfg_obj_isboolean(obj)) {
+               view->enablevalidation = cfg_obj_asboolean(obj);
+       } else {
                /*
-                * Default to VALIDATION_DEFAULT as set in config.c.
+                * If dnssec-validation is set but not boolean,
+                * then it must be "auto"
                 */
-               (void)cfg_map_get(named_g_defaultoptions, "dnssec-validation",
-                                 &obj);
-               INSIST(obj != NULL);
-       }
-       if (obj != NULL) {
-               if (cfg_obj_isboolean(obj)) {
-                       view->enablevalidation = cfg_obj_asboolean(obj);
-               } else {
-                       /*
-                        * If dnssec-validation is set but not boolean,
-                        * then it must be "auto"
-                        */
-                       view->enablevalidation = true;
-                       auto_root = true;
-               }
+               view->enablevalidation = true;
+               auto_root = true;
        }
 
        obj = NULL;