]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] spurious spaces in named-checkconf -p
authorEvan Hunt <each@isc.org>
Mon, 14 Sep 2015 15:50:17 +0000 (08:50 -0700)
committerEvan Hunt <each@isc.org>
Mon, 14 Sep 2015 15:50:17 +0000 (08:50 -0700)
4205. [bug] 'named-checkconf -p' could include unwanted spaces
when printing tuples with unset optional fields.
[RT #40731]

CHANGES
bin/tests/system/checkconf/good.conf
lib/isccfg/parser.c

diff --git a/CHANGES b/CHANGES
index e4556d84725fcc712ae090ccd04bb42b8559a9a8..fd55fd0140c5ce7449193316120d9abac61560b2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+4205.  [bug]           'named-checkconf -p' could include unwanted spaces
+                       when printing tuples with unset optional fields.
+                       [RT #40731]
+
 4204.  [bug]           'dig +trace' failed to lookup the correct type if
                        the initial root ns query was retried. [RT #40296]
 
index cf886a242776856e35ab5220c40f80dc5f1fece5..c4320233e1f88d5ed9935bcbb7ddc970c61d0700 100644 (file)
@@ -116,7 +116,7 @@ view "second" {
        zone "." {
                type redirect;
                masters {
-                       1.2.3.4 ;
+                       1.2.3.4;
                };
        };
        dnssec-lookaside "." trust-anchor "dlv.isc.org.";
index d4167d72d7c6f72aebc85d3c3384103b54d57b37..17b5c628c3aa4cfd621006c631629684460e808f 100644 (file)
@@ -272,10 +272,11 @@ cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj) {
 
        for (f = fields, i = 0; f->name != NULL; f++, i++) {
                const cfg_obj_t *fieldobj = obj->value.tuple[i];
-               if (need_space)
+               if (need_space && fieldobj->type->rep != &cfg_rep_void)
                        cfg_print_cstr(pctx, " ");
                cfg_print_obj(pctx, fieldobj);
-               need_space = ISC_TF(fieldobj->type->print != cfg_print_void);
+               need_space = ISC_TF(need_space ||
+                                   fieldobj->type->print != cfg_print_void);
        }
 }