Commit 625f656a authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

When processing delzone, write one zone config per line to the NZF (#46323)

parent 278b68ce
4800. [bug] When processing delzone, write one zone config per
line to the NZF. [RT #46323]
4799. [cleanup] Improve clarity of keytable unit tests. [RT #46407]
 
4798. [func] Keys specified in "managed-keys" statements
......
......@@ -11772,6 +11772,10 @@ nzf_append(dns_view_t *view, const cfg_obj_t *zconfig) {
static isc_result_t
nzf_writeconf(const cfg_obj_t *config, dns_view_t *view) {
const cfg_obj_t *zl = NULL;
cfg_list_t *list;
const cfg_listelt_t *elt;
FILE *fp = NULL;
char tmp[1024];
isc_result_t result;
......@@ -11783,9 +11787,24 @@ nzf_writeconf(const cfg_obj_t *config, dns_view_t *view) {
if (result != ISC_R_SUCCESS)
return (result);
cfg_map_get(config, "zone", &zl);
if (!cfg_obj_islist(zl))
CHECK(ISC_R_FAILURE);
DE_CONST(&zl->value.list, list);
CHECK(add_comment(fp, view->name)); /* force a comment */
cfg_printx(config, CFG_PRINTER_ONELINE, dumpzone, fp);
for (elt = ISC_LIST_HEAD(*list);
elt != NULL;
elt = ISC_LIST_NEXT(elt, link))
{
const cfg_obj_t *zconfig = cfg_listelt_value(elt);
CHECK(isc_stdio_write("zone ", 5, 1, fp, NULL));
cfg_printx(zconfig, CFG_PRINTER_ONELINE, dumpzone, fp);
CHECK(isc_stdio_write(";\n", 2, 1, fp, NULL));
}
CHECK(isc_stdio_flush(fp));
result = isc_stdio_close(fp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment