Fix parsing of NZFs saved by rndc addzone with view specified (#39845)

(cherry picked from commit 0439bfedd9)

Conflicts:
	bin/named/server.c
	bin/tests/system/addzone/tests.sh
This commit is contained in:
Mukund Sivaraman
2015-06-23 14:54:34 +05:30
parent 17bb17af46
commit 8134e7662e
3 changed files with 32 additions and 18 deletions

View File

@@ -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]

View File

@@ -267,6 +267,17 @@ 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:deleting newly added zone ($n)"
ret=0

View File

@@ -1711,24 +1711,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 *
@@ -1932,6 +1914,23 @@ LIBISCCFG_EXTERNAL_DATA cfg_type_t cfg_type_addzoneconf = {
&cfg_rep_map, addzoneconf_clausesets
};
/*% The new-zone-file syntax (for zones added by 'rndc addzone') */
static cfg_clausedef_t
newzones_clauses[] = {
{ "zone", &cfg_type_addzone, 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
};
static isc_result_t
parse_unitstring(char *str, isc_resourcevalue_t *valuep) {