]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix dnssec-signzone and -verify logging (again)
authorMatthijs Mekking <matthijs@isc.org>
Tue, 5 Jan 2021 11:06:23 +0000 (12:06 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Tue, 5 Jan 2021 12:41:49 +0000 (13:41 +0100)
While fixing #2359, 'report()' was changed so that it would print the
newline.

Newlines were missing from the output of 'dnssec-signzone'
and 'dnssec-verify' because change
664b8f04f5f2322086138f5eda5899a62bcc019b moved the printing from
newlines to the library.

This had to be reverted because this also would print redundant
newlines in logfiles.

While doing the revert, some newlines in 'lib/dns/zoneverify.c'
were left in place, now making 'dnssec-signzone' and 'dnssec-verify'
print too many newlines.

This commit removes those newlines, so that the output looks nice
again.

(cherry picked from commit 18c62a077ec0f7f1c56564dc2bd45b0c80e5b2f7)

CHANGES
lib/dns/zoneverify.c

diff --git a/CHANGES b/CHANGES
index 89cc0ae6c7f30aad2b7ae8097079c188db579b55..3cb1bd3e37b63c63078d9b48e9590e1d9e83000b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+5556.  [bug]           dnssec-signzone and dnssec-verify where now
+                       printing too many newlines between log messages.
+                       [GL #2359]
+
 5555.  [bug]           server->reload_status was not properly initialised.
                        [GL #2361]
 
index f553a0905a8e064cee6213bdb80ba3f1e8e65963..4219a710e5f97e838ae0a67eea687e829d3e4c59 100644 (file)
@@ -1686,10 +1686,9 @@ determine_active_algorithms(vctx_t *vctx, bool ignore_kskflag,
                }
                if (vctx->act_algorithms[i] != 0) {
                        dns_secalg_format(i, algbuf, sizeof(algbuf));
-                       report(" %s", algbuf);
+                       report("- %s", algbuf);
                }
        }
-       report(".\n");
 
        if (ignore_kskflag || keyset_kskonly) {
                return;
@@ -1933,7 +1932,7 @@ check_bad_algorithms(const vctx_t *vctx, void (*report)(const char *, ...)) {
        }
 
        if (!first) {
-               report(".\n");
+               report(".");
        }
 
        return (first ? ISC_R_SUCCESS : ISC_R_FAILURE);
@@ -1945,7 +1944,7 @@ print_summary(const vctx_t *vctx, bool keyset_kskonly,
        char algbuf[DNS_SECALG_FORMATSIZE];
        int i;
 
-       report("Zone fully signed:\n");
+       report("Zone fully signed:");
        for (i = 0; i < 256; i++) {
                if ((vctx->ksk_algorithms[i] == 0) &&
                    (vctx->standby_ksk[i] == 0) &&
@@ -1957,11 +1956,11 @@ print_summary(const vctx_t *vctx, bool keyset_kskonly,
                }
                dns_secalg_format(i, algbuf, sizeof(algbuf));
                report("Algorithm: %s: KSKs: "
-                      "%u active, %u stand-by, %u revoked\n",
+                      "%u active, %u stand-by, %u revoked",
                       algbuf, vctx->ksk_algorithms[i], vctx->standby_ksk[i],
                       vctx->revoked_ksk[i]);
                report("%*sZSKs: "
-                      "%u active, %u %s, %u revoked\n",
+                      "%u active, %u %s, %u revoked",
                       (int)strlen(algbuf) + 13, "", vctx->zsk_algorithms[i],
                       vctx->standby_zsk[i],
                       keyset_kskonly ? "present" : "stand-by",
@@ -2024,13 +2023,13 @@ dns_zoneverify_dnssec(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver,
 
        result = check_bad_algorithms(&vctx, report);
        if (result != ISC_R_SUCCESS) {
-               report("DNSSEC completeness test failed.\n");
+               report("DNSSEC completeness test failed.");
                goto done;
        }
 
        result = vresult;
        if (result != ISC_R_SUCCESS) {
-               report("DNSSEC completeness test failed (%s).\n",
+               report("DNSSEC completeness test failed (%s).",
                       dns_result_totext(result));
                goto done;
        }