]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check remote-servers list correctness
authorColin Vidal <colin@isc.org>
Tue, 25 Nov 2025 14:34:26 +0000 (15:34 +0100)
committerColin Vidal <colin@isc.org>
Fri, 28 Nov 2025 08:10:54 +0000 (09:10 +0100)
`check.c` only checks if `remote-servers`, `primaries`, etc. are not
duplicated inside the configuration file, but does not check the
correctness of its definition. This commit fixes this by calling
`validate_remotes()` for each `remote-servers` (and other aliases),
which validates the correctness of the definition itself (this is the
same call done to validate other cases like `also-notify`, etc.).

lib/isccfg/check.c

index 022e29d0dad7e6368d1cde8b5bf7e7aa5a2829ec..6ff5b12a0bdbbb42762dfa3ad0ed70ffb48bdc2d 100644 (file)
@@ -84,6 +84,9 @@ keydirexist(const cfg_obj_t *zcgf, const char *optname, dns_name_t *zname,
 static const cfg_obj_t *
 find_maplist(const cfg_obj_t *config, const char *listname, const char *name);
 
+static isc_result_t
+validate_remotes(const cfg_obj_t *obj, const cfg_obj_t *config,
+                uint32_t *countp, isc_mem_t *mctx);
 static void
 freekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) {
        UNUSED(type);
@@ -2084,6 +2087,12 @@ check_remoteserverlist(const cfg_obj_t *cctx, const char *list,
                        result = tresult;
                        break;
                }
+
+               uint32_t dummy = 0;
+               result = validate_remotes(obj, cctx, &dummy, mctx);
+               if (result != ISC_R_SUCCESS) {
+                       break;
+               }
        }
        return result;
 }