]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Include all views in output of `rndc validation status`
authorTony Finch <dot@dotat.at>
Tue, 15 Oct 2019 14:06:01 +0000 (15:06 +0100)
committerOndřej Surý <ondrej@sury.org>
Thu, 31 Oct 2019 16:28:00 +0000 (11:28 -0500)
The implementation of `rndc validation status` iterates over all the
views to print their validation status. It takes care to print newlines
in between, but it also used put a nul byte at the end of the first view
which truncated the output.

After this change, the nul byte is added at the end so that it prints
the validation status in all views. The `_bind` view is skipped
because its validation status is irrelevant.

bin/named/server.c

index ea505135f54ae5fd89db69ea7e7c098f39934f39..452b38945d8ba4561d0c00cac3a087fb7196f1c7 100644 (file)
@@ -11078,7 +11078,8 @@ named_server_validation(named_server_t *server, isc_lex_t *lex,
             view != NULL;
             view = ISC_LIST_NEXT(view, link))
        {
-               if (ptr != NULL && strcasecmp(ptr, view->name) != 0)
+               if ((ptr != NULL && strcasecmp(ptr, view->name) != 0)
+                   || strcasecmp("_bind", view->name) == 0)
                        continue;
                CHECK(dns_view_flushcache(view, false));
 
@@ -11094,10 +11095,10 @@ named_server_validation(named_server_t *server, isc_lex_t *lex,
                        CHECK(putstr(text, " (view "));
                        CHECK(putstr(text, view->name));
                        CHECK(putstr(text, ")"));
-                       CHECK(putnull(text));
                        first = false;
                }
        }
+       CHECK(putnull(text));
 
        if (!set)
                result = ISC_R_SUCCESS;