]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2909. [bug] named-checkzone -p could die if "update-policy local;"
authorMark Andrews <marka@isc.org>
Wed, 2 Jun 2010 01:10:06 +0000 (01:10 +0000)
committerMark Andrews <marka@isc.org>
Wed, 2 Jun 2010 01:10:06 +0000 (01:10 +0000)
                        was specified in named.conf. [RT #21416]

CHANGES
bin/tests/system/checkconf/good.conf
bin/tests/system/checkconf/tests.sh
lib/isccfg/namedconf.c

diff --git a/CHANGES b/CHANGES
index 43c4368b11a952f0ed6ae2eb257fd7ee834b9cef..bc53c72828daf833fd5e9692df6376539fb16261 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2909.  [bug]           named-checkzone -p could die if "update-policy local;"
+                       was specified in named.conf. [RT #21416]
+
 2908.  [bug]           It was possible for re-signing to stop after removing
                        a DNSKEY. [RT #21384]
 
index c810b47d2c3d699f2d1e00b77da775e584e87ed0..74c77a2d0d411ddfdbe28a0f9ccfdffdfc176264 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: good.conf,v 1.4 2007/06/19 23:47:01 tbox Exp $ */
+/* $Id: good.conf,v 1.4.558.1 2010/06/02 01:10:06 marka Exp $ */
 
 /*
  * This is just a random selection of configuration options.
@@ -54,3 +54,9 @@ options {
        serial-query-rate 100;
        server-id none;
 };
+
+zone "example1" {
+       type master;
+       file "xxx";
+       update-policy local;
+};
index 8444664b76a27ad087ae054d8fa7c32aadc6f464..42326ee3c4bee250635ea37ea9351841383888c4 100644 (file)
@@ -12,7 +12,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.3 2007/06/19 23:47:01 tbox Exp $
+# $Id: tests.sh,v 1.3.558.1 2010/06/02 01:10:06 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -26,6 +26,11 @@ $CHECKCONF good.conf > /dev/null 2>&1 || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I: checking that named-checkconf prints a known good config"
+ret=0
+$CHECKCONF -p good.conf > /dev/null 2>&1 || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
 echo "I: checking that named-checkconf handles a known bad config"
 
 ret=1
index 29e2791f8d0188e5030379908cedf8f82793f7f8..d512cb257669a1662b951c7973630e6195b4f3a3 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: namedconf.c,v 1.113.4.3 2010/05/21 14:13:48 marka Exp $ */
+/* $Id: namedconf.c,v 1.113.4.4 2010/06/02 01:10:06 marka Exp $ */
 
 /*! \file */
 
@@ -64,6 +64,8 @@ parse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type,
 static isc_result_t
 parse_updatepolicy(cfg_parser_t *pctx, const cfg_type_t *type,
                   cfg_obj_t **ret);
+static void
+print_updatepolicy(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 static void
 doc_updatepolicy(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -342,8 +344,8 @@ static cfg_type_t cfg_type_grant = {
 };
 
 static cfg_type_t cfg_type_updatepolicy = {
-       "update_policy", parse_updatepolicy, NULL, doc_updatepolicy,
-       &cfg_rep_list, &cfg_type_grant
+       "update_policy", parse_updatepolicy, print_updatepolicy,
+       doc_updatepolicy, &cfg_rep_list, &cfg_type_grant
 };
 
 static isc_result_t
@@ -381,6 +383,14 @@ parse_updatepolicy(cfg_parser_t *pctx, const cfg_type_t *type,
        return (result);
 }
 
+static void
+print_updatepolicy(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+       if (cfg_obj_isstring(obj))
+               cfg_print_ustring(pctx, obj);
+       else
+               cfg_print_bracketed_list(pctx, obj);
+}
+
 static void
 doc_updatepolicy(cfg_printer_t *pctx, const cfg_type_t *type) {
        cfg_print_cstr(pctx, "( local | { ");