]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1770. [bug] named-checkconf failed to report missing a missing
authorMark Andrews <marka@isc.org>
Mon, 22 Nov 2004 05:03:11 +0000 (05:03 +0000)
committerMark Andrews <marka@isc.org>
Mon, 22 Nov 2004 05:03:11 +0000 (05:03 +0000)
                        file clause for rbt{64} master/hint zones. [RT#13009]

CHANGES
lib/bind9/check.c

diff --git a/CHANGES b/CHANGES
index d2499d08b9d3495cd7d8b40fae9e71f892527897..e3b1546c7ae51be92b2db1f2a3a13d7c22b7fb63 100644 (file)
--- 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.
 
index 7b5642a76a88b0b8e44711a22f05e6194f2d7e9a..8b4772060ee2ca3b12125eb9c2ed2fe823c10cb6 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: check.c,v 1.50 2004/11/09 21:24:20 marka Exp $ */
+/* $Id: check.c,v 1.51 2004/11/22 05:03:11 marka Exp $ */
 
 #include <config.h>
 
@@ -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 },
        { "journal", MASTERZONE | SLAVEZONE },
        { "ixfr-base", MASTERZONE | SLAVEZONE },
        { "ixfr-tmp-file", MASTERZONE | SLAVEZONE },
@@ -944,6 +944,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);
 }