From 47ffd357ea8c0e4e84b0e3d04d39d57aa303da4e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 22 Nov 2004 05:02:41 +0000 Subject: [PATCH] 1770. [bug] named-checkconf failed to report missing a missing file clause for rbt{64} master/hint zones. [RT#13009] --- CHANGES | 3 +++ lib/bind9/check.c | 25 +++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 070d6a702b..84e49213bb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1770. [bug] named-checkconf failed to report missing a missing + file clause for rbt{64} master/hint zones. [RT#13009] + 1769. [port] win32: change compiler flags /MTd ==> /MDd, /MT ==> /MD. diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 23b183e2bf..0cf1e75627 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check.c,v 1.37.6.28 2004/07/29 00:08:08 marka Exp $ */ +/* $Id: check.c,v 1.37.6.29 2004/11/22 05:02:41 marka Exp $ */ #include @@ -732,7 +732,7 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab, { "zone-statistics", MASTERZONE | SLAVEZONE | STUBZONE }, { "allow-update", MASTERZONE }, { "allow-update-forwarding", SLAVEZONE }, - { "file", MASTERZONE | SLAVEZONE | STUBZONE | HINTZONE}, + { "file", MASTERZONE | SLAVEZONE | STUBZONE | HINTZONE }, { "ixfr-base", MASTERZONE | SLAVEZONE }, { "ixfr-tmp-file", MASTERZONE | SLAVEZONE }, { "masters", SLAVEZONE | STUBZONE }, @@ -943,6 +943,27 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab, if (tresult != ISC_R_SUCCESS) result = tresult; + /* + * If the zone type is rbt/rbt64 then master/hint zones + * require file clauses. + */ + obj = NULL; + tresult = cfg_map_get(zoptions, "database", &obj); + if (tresult == ISC_R_NOTFOUND || + (tresult == ISC_R_SUCCESS && + (strcmp("rbt", cfg_obj_asstring(obj)) == 0 || + strcmp("rbt64", cfg_obj_asstring(obj)) == 0))) { + obj = NULL; + tresult = cfg_map_get(zoptions, "file", &obj); + if (tresult != ISC_R_SUCCESS && + (ztype == MASTERZONE || ztype == HINTZONE)) { + cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, + "zone '%s': missing 'file' entry", + zname); + result = tresult; + } + } + return (result); }