]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix parsing of NZFs saved by rndc addzone with view specified (#39845)
authorMukund Sivaraman <muks@isc.org>
Tue, 23 Jun 2015 08:49:48 +0000 (14:19 +0530)
committerMukund Sivaraman <muks@isc.org>
Tue, 23 Jun 2015 08:49:48 +0000 (14:19 +0530)
CHANGES
bin/named/server.c
bin/tests/system/addzone/tests.sh
lib/isccfg/namedconf.c

diff --git a/CHANGES b/CHANGES
index ee2c63d7070ee68e9501d3b915f8f856f91709c6..9d31a1271be7ae8141ea2a9e941114ad04c47160 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+4142.  [bug]           rndc addzone with view specified saved NZF config
+                       that could not be read back by named. This has now
+                       been fixed. [RT #39845]
+
 4141.  [bug]           A formatting bug caused rndc zonestatus to print
                        negative numbers for large serial values. This has
                        now been fixed. [RT #39854]
index ca850f361322de18d7bed6e7e864cd9e115869ae..55982c6ff3681a8f0e3b0bbb3545bd50b0234a7c 100644 (file)
@@ -5374,7 +5374,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
         */
        cfg_parser_reset(ns_g_addparser);
        result = cfg_parse_file(ns_g_addparser, view->new_zone_file,
-                               &cfg_type_newzones, &nzcfg->nzconfig);
+                               &cfg_type_addzoneconf, &nzcfg->nzconfig);
 
        return (ISC_R_SUCCESS);
 }
index 849376624efbeeb582ebc4114cc034427a4d1fbd..ffa934ef57d548e591cdb9019a540344c4ea2858 100755 (executable)
@@ -311,6 +311,18 @@ n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:checking rndc reload causes named to reload the external view's NZF file ($n)"
+ret=0
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
+$DIG +norec $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.added.example a > dig.out.ns2.int.$n || ret=1
+grep 'status: NOERROR' dig.out.ns2.int.$n > /dev/null || ret=1
+$DIG +norec $DIGOPTS @10.53.0.4 -b 10.53.0.4 a.added.example a > dig.out.ns2.ext.$n || ret=1
+grep 'status: NOERROR' dig.out.ns2.ext.$n > /dev/null || ret=1
+grep '^a.added.example' dig.out.ns2.ext.$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:checking rndc showzone with newly added zone ($n)"
 ret=0
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 showzone added.example in external > rndc.out.ns2.$n
index cc2ebde89bb3413b61fee008e3bd0fdbbba2721a..e2b9207ff14e2fafaa4876cd65ef4bcc3e117c48 100644 (file)
@@ -1731,24 +1731,6 @@ LIBISCCFG_EXTERNAL_DATA cfg_type_t cfg_type_bindkeys = {
        &cfg_rep_map, bindkeys_clausesets
 };
 
-/*% The new-zone-file syntax (for zones added by 'rndc addzone') */
-static cfg_clausedef_t
-newzones_clauses[] = {
-       { "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
-       { NULL, NULL, 0 }
-};
-
-static cfg_clausedef_t *
-newzones_clausesets[] = {
-       newzones_clauses,
-       NULL
-};
-
-LIBISCCFG_EXTERNAL_DATA cfg_type_t cfg_type_newzones = {
-       "newzones", cfg_parse_mapbody, cfg_print_mapbody, cfg_doc_mapbody,
-       &cfg_rep_map, newzones_clausesets
-};
-
 /*% The "options" statement syntax. */
 
 static cfg_clausedef_t *
@@ -1956,6 +1938,13 @@ LIBISCCFG_EXTERNAL_DATA cfg_type_t cfg_type_addzoneconf = {
        &cfg_rep_map, addzoneconf_clausesets
 };
 
+/*
+ * XXXMPA Remove in 9.11.  Backwards API compat only.
+ */
+LIBISCCFG_EXTERNAL_DATA cfg_type_t cfg_type_newzones = {
+       "newzones", cfg_parse_mapbody, cfg_print_mapbody, cfg_doc_mapbody,
+       &cfg_rep_map, addzoneconf_clausesets
+};
 
 static isc_result_t
 parse_unitstring(char *str, isc_resourcevalue_t *valuep) {