4850. [bug] Named failed to restart with multiple added zones in

lmdb database. [RT #46889]

(cherry picked from commit 9bec7facfb)
This commit is contained in:
Mark Andrews 2017-12-27 16:24:33 +11:00
parent ebc438edb1
commit c0a2210466
3 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,6 @@
4850. [bug] Named failed to restart with multiple added zones in
lmdb database. [RT #46889]
4849. [bug] Duplicate zones could appear in the .nzf file if
addzone failed. [RT #46435]

View file

@ -6967,7 +6967,7 @@ for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config,
cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view,
cfg_aclconfctx_t *actx, MDB_txn *txn, MDB_dbi dbi)
{
const cfg_obj_t *zconfig, *zlist = NULL;
const cfg_obj_t *zconfig, *zlist;
isc_result_t result = ISC_R_SUCCESS;
cfg_obj_t *zconfigobj = NULL;
isc_buffer_t *text = NULL;
@ -6995,6 +6995,7 @@ for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config,
/*
* Extract zone configuration from configuration object.
*/
zlist = NULL;
result = cfg_map_get(zconfigobj, "zone", &zlist);
if (result != ISC_R_SUCCESS) {
break;

View file

@ -518,5 +518,17 @@ then
status=`expr $status + $ret`
fi
echo "I:check that named restarts with multiple added zones ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 addzone "test4.baz" '{ type master; file "e.db"; };' > /dev/null 2>&1 || ret=1
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 addzone "test5.baz" '{ type master; file "e.db"; };' > /dev/null 2>&1 || ret=1
$PERL $SYSTEMTESTTOP/stop.pl . ns3
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart . ns3 || ret=1
$DIG -p 5300 @10.53.0.3 version.bind txt ch > dig.out.test$n || ret=1
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1