]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
When processing delzone, write one zone config per line to the NZF (#46323)
authorMukund Sivaraman <muks@isc.org>
Sun, 29 Oct 2017 02:10:20 +0000 (07:40 +0530)
committerMukund Sivaraman <muks@isc.org>
Sun, 29 Oct 2017 02:10:20 +0000 (07:40 +0530)
CHANGES
bin/named/server.c

diff --git a/CHANGES b/CHANGES
index 75823ee5550a2adea3cccce9a3cce552c6e85d3d..409c21671bcb288dffe94334bcce938afce9d639 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+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
index 0a4ade0e7c1a39a07336f0b03d2cb93fd444b929..cfdb0b1cbf816a9d0e80e15379fbf35b9cc9dc6d 100644 (file)
@@ -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);