]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] forbid inline-signing slave with no file
authorEvan Hunt <each@isc.org>
Wed, 20 Feb 2013 22:01:31 +0000 (14:01 -0800)
committerEvan Hunt <each@isc.org>
Wed, 20 Feb 2013 22:01:31 +0000 (14:01 -0800)
3491. [bug] Slave zones using inline-signing must specify a
file name. [RT #31946]

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

diff --git a/CHANGES b/CHANGES
index 54d36400112cfe952e65e77bcca9d689c6bffb4b..3cec7e7ba854906a1a6d10c6cacd19ed328b3ecf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3491.  [bug]           Slave zones using inline-signing must specify a
+                       file name. [RT #31946]
+
 3490.  [bug]           When logging RDATA during update, truncate if it's
                         too long. [RT #32365]
 
diff --git a/bin/tests/system/checkconf/bad-inline-slave.conf b/bin/tests/system/checkconf/bad-inline-slave.conf
new file mode 100644 (file)
index 0000000..06d9cfd
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2005, 2007, 2010-2012  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ /*
+  * An inline-signing slave should be forced to have a file option
+  */
+  
+  zone "." {
+          type slave;
+          inline-signing yes;
+          masters { 10.53.0.1; };
+  };
\ No newline at end of file
index 413686801fc8d8e009d07e287bdad8b35f9fb189..56ae672f9fa4603c61e604fe6e28f4c1831d805e 100644 (file)
@@ -1876,6 +1876,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
        /*
         * If the zone type is rbt/rbt64 then master/hint zones
         * require file clauses.
+        * If inline signing is used, then slave zones require a
+        * file clause as well
         */
        obj = NULL;
        dlz = ISC_FALSE;
@@ -1896,13 +1898,17 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
             (strcmp("rbt", cfg_obj_asstring(obj)) == 0 ||
              strcmp("rbt64", cfg_obj_asstring(obj)) == 0))))
        {
+               isc_result_t res1;
                obj = NULL;
                tresult = cfg_map_get(zoptions, "file", &obj);
-               if (tresult != ISC_R_SUCCESS &&
-                   (ztype == MASTERZONE || ztype == HINTZONE)) {
+               obj = NULL;
+               res1 = cfg_map_get(zoptions, "inline-signing", &obj);
+               if ((tresult != ISC_R_SUCCESS &&
+                   (ztype == MASTERZONE || ztype == HINTZONE)) || 
+                   (ztype == SLAVEZONE && res1 == ISC_R_SUCCESS)) {
                        cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR,
-                                   "zone '%s': missing 'file' entry",
-                                   znamestr);
+                           "zone '%s': missing 'file' entry",
+                           znamestr);
                        result = tresult;
                }
        }