]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3795. [bug] Make named-checkconf detect raw masterfiles for
authorMukund Sivaraman <muks@isc.org>
Sun, 30 Mar 2014 23:22:59 +0000 (04:52 +0530)
committerMukund Sivaraman <muks@isc.org>
Sun, 30 Mar 2014 23:25:37 +0000 (04:55 +0530)
                        hint zones and reject them. [RT #35268]

Squashed commit of the following:

commit 5b0254711d6b77940d6217b9131b9d401df8a866
Author: Mukund Sivaraman <muks@isc.org>
Date:   Fri Mar 28 02:09:01 2014 +0530

    Remove redundant helper function

commit a4341c1a2ba830c8cee1def57a533f987f67c3dc
Author: Mark Andrews <marka@isc.org>
Date:   Thu Jan 30 10:08:17 2014 +1100

    error out if masterfile-format raw is specified for a hint zone.

CHANGES
bin/check/named-checkconf.c
bin/tests/system/checkconf/bad-hint.conf [new file with mode: 0644]
lib/bind9/check.c

diff --git a/CHANGES b/CHANGES
index 82a498865eca6bb0d7e9c205489be9009b9f134e..24a4b8587d1310d1512585348580540e9bb4182a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3795.  [bug]           Make named-checkconf detect raw masterfiles for
+                       hint zones and reject them. [RT #35268]
+
 3794.  [maint]         Added AAAA for C.ROOT-SERVERS.NET.
 
 3793.  [bug]           zone.c:save_nsec3param() could assert when out of
index 97c919fe0a45db280bcca99ab774234862206ec1..7b7f4ea509994027c242f9de23a8c93828e5072b 100644 (file)
@@ -142,18 +142,6 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
        }
 }
 
-static isc_result_t
-config_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
-       int i;
-
-       for (i = 0;; i++) {
-               if (maps[i] == NULL)
-                       return (ISC_R_NOTFOUND);
-               if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
-                       return (ISC_R_SUCCESS);
-       }
-}
-
 static isc_result_t
 configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
        isc_result_t result;
@@ -367,8 +355,7 @@ configure_zone(const char *vclass, const char *view,
 
        masterformat = dns_masterformat_text;
        fmtobj = NULL;
-       result = config_get(maps, "masterfile-format", &fmtobj);
-       if (result == ISC_R_SUCCESS) {
+       if (get_maps(maps, "masterfile-format", &fmtobj)) {
                const char *masterformatstr = cfg_obj_asstring(fmtobj);
                if (strcasecmp(masterformatstr, "text") == 0)
                        masterformat = dns_masterformat_text;
diff --git a/bin/tests/system/checkconf/bad-hint.conf b/bin/tests/system/checkconf/bad-hint.conf
new file mode 100644 (file)
index 0000000..eef12f1
--- /dev/null
@@ -0,0 +1,5 @@
+zone "." {
+       type hint;
+       masterfile-format raw;
+       file "hint";
+};
index 153157610fd781ae73d3e15859afde3669d9a2af..faa467cba0ba29f1c1d960d5e283f2256631faf5 100644 (file)
@@ -1486,7 +1486,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
        { "integrity-check", MASTERZONE },
        { "check-mx-cname", MASTERZONE },
        { "check-srv-cname", MASTERZONE },
-       { "masterfile-format", MASTERZONE | SLAVEZONE | STUBZONE | HINTZONE |
+       { "masterfile-format", MASTERZONE | SLAVEZONE | STUBZONE |
          REDIRECTZONE },
        { "update-check-ksk", MASTERZONE | SLAVEZONE },
        { "dnssec-dnskey-kskonly", MASTERZONE | SLAVEZONE },