dns_zone_t *zone = NULL;
bool added;
bool locked = false;
+ const cfg_obj_t *options = NULL;
#ifndef HAVE_LMDB
FILE *fp = NULL;
cfg_obj_t *z;
if (!added) {
if (cfg->vconfig == NULL) {
- result = delete_zoneconf(
- view, cfg->conf_parser, cfg->config,
- dns_zone_getorigin(zone), NULL, locked);
+ options = cfg->config;
} else {
- const cfg_obj_t *voptions = cfg_tuple_get(cfg->vconfig,
- "options");
- result = delete_zoneconf(
- view, cfg->conf_parser, voptions,
- dns_zone_getorigin(zone), NULL, locked);
+ options = cfg_tuple_get(cfg->vconfig, "options");
}
-
+ result = delete_zoneconf(view, cfg->conf_parser, options,
+ dns_zone_getorigin(zone), NULL,
+ locked);
if (result != ISC_R_SUCCESS) {
TCHECK(putstr(text, "former zone configuration "
"not deleted: "));
TCHECK(putstr(text, zname));
TCHECK(putstr(text, "' reconfigured."));
} else {
+ CHECK(cfg_parser_mapadd(cfg->conf_parser, UNCONST(options),
+ UNCONST(zoneobj), "zone"));
+
TCHECK(putstr(text, "zone '"));
TCHECK(putstr(text, zname));
TCHECK(putstr(text, "' must also be reconfigured in\n"));
raise_on_exception=False,
)
assert cmd.rc == 0
+
+ # Confirm that the modzone took effect in 'rndc showzone'.
+ cmd = ns3.rndc("showzone .", raise_on_exception=False)
+ assert cmd.rc == 0
+ assert 'allow-query { "none"; }' in cmd.out
+
+ # Confirm that 'rndc modzone' still works after the first modzone.
+ # This was not the case before as the zone config was incorrectly
+ # removed in-memory after the first modzone.
+ cmd = ns3.rndc(
+ 'modzone . {type primary; file "redirect.db"; allow-query {any;};};',
+ raise_on_exception=False,
+ )
+ assert cmd.rc == 0
+
+ # Confirm that the second modzone took effect in 'rndc showzone'.
+ cmd = ns3.rndc("showzone .", raise_on_exception=False)
+ assert cmd.rc == 0
+ assert 'allow-query { "any"; }' in cmd.out