diff --git a/CHANGES b/CHANGES index ee2c63d707..9d31a1271b 100644 --- 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] diff --git a/bin/named/server.c b/bin/named/server.c index ca850f3613..55982c6ff3 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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); } diff --git a/bin/tests/system/addzone/tests.sh b/bin/tests/system/addzone/tests.sh index 849376624e..ffa934ef57 100755 --- a/bin/tests/system/addzone/tests.sh +++ b/bin/tests/system/addzone/tests.sh @@ -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 diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index cc2ebde89b..e2b9207ff1 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -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) {