]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Non empty 'catalog-zones' implies that 'allow-new-zones' is true
authorAram Sargsyan <aram@isc.org>
Tue, 9 Jul 2024 10:41:19 +0000 (10:41 +0000)
committerPetr Špaček <pspacek@isc.org>
Tue, 13 Aug 2024 14:57:50 +0000 (16:57 +0200)
This condition in catalog zone processing functions is checked only
for sanity, so there is no meaning for a log message that normally
shouldn't be ever logged.

(cherry picked from commit 0b3c8ee55e6cda1f2de35aa15f6a4d82d072c309)

bin/named/server.c

index d5b39ddcb30a9550dc8fd0d8642faeed9fc2a255..84169c619de08ab6453c48b470066ed60f61f819 100644 (file)
@@ -2686,13 +2686,13 @@ catz_addmodzone_cb(void *arg) {
                goto cleanup;
        }
 
+       /*
+        * A non-empty 'catalog-zones' statement implies that 'allow-new-zones'
+        * is true, so this is expected to be non-NULL.
+        */
        cfg = (ns_cfgctx_t *)cz->view->new_zone_config;
        if (cfg == NULL) {
-               isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
-                             NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
-                             "catz: allow-new-zones statement missing from "
-                             "config; cannot add zone from the catalog");
-               goto cleanup;
+               CHECK(ISC_R_FAILURE);
        }
 
        name = dns_catz_entry_getname(cz->entry);
@@ -3064,14 +3064,13 @@ catz_reconfigure(dns_catz_entry_t *entry, void *arg1, void *arg2) {
                return;
        }
 
+       /*
+        * A non-empty 'catalog-zones' statement implies that 'allow-new-zones'
+        * is true, so this is expected to be non-NULL.
+        */
        cfg = (ns_cfgctx_t *)view->new_zone_config;
        if (cfg == NULL) {
-               isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
-                             NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
-                             "catz_reconfigure: allow-new-zones statement "
-                             "missing from config; cannot reconfigure a "
-                             "member zone");
-               goto cleanup;
+               CHECK(ISC_R_FAILURE);
        }
 
        result = dns_catz_generate_zonecfg(data->catz, entry, &confbuf);