mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
3057. [bug] "rndc secroots" would abort after the first error
and so could miss some views. [RT #23488]
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: server.c,v 1.605 2011/03/03 04:42:25 each Exp $ */
|
||||
/* $Id: server.c,v 1.606 2011/03/03 16:16:43 each Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@@ -6305,28 +6305,29 @@ ns_server_dumpsecroots(ns_server_t *server, char *args) {
|
||||
isc_time_formattimestamp(&now, tbuf, sizeof(tbuf));
|
||||
fprintf(fp, "%s\n", tbuf);
|
||||
|
||||
nextview:
|
||||
for (view = ISC_LIST_HEAD(server->viewlist);
|
||||
view != NULL;
|
||||
view = ISC_LIST_NEXT(view, link))
|
||||
{
|
||||
if (ptr != NULL && strcmp(view->name, ptr) != 0)
|
||||
continue;
|
||||
if (secroots != NULL)
|
||||
dns_keytable_detach(&secroots);
|
||||
result = dns_view_getsecroots(view, &secroots);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
result = ISC_R_SUCCESS;
|
||||
continue;
|
||||
do {
|
||||
for (view = ISC_LIST_HEAD(server->viewlist);
|
||||
view != NULL;
|
||||
view = ISC_LIST_NEXT(view, link))
|
||||
{
|
||||
if (ptr != NULL && strcmp(view->name, ptr) != 0)
|
||||
continue;
|
||||
if (secroots != NULL)
|
||||
dns_keytable_detach(&secroots);
|
||||
result = dns_view_getsecroots(view, &secroots);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
result = ISC_R_SUCCESS;
|
||||
continue;
|
||||
}
|
||||
fprintf(fp, "\n Start view %s\n\n", view->name);
|
||||
result = dns_keytable_dump(secroots, fp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fprintf(fp, " dumpsecroots failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
fprintf(fp, "\n Start view %s\n\n", view->name);
|
||||
CHECK(dns_keytable_dump(secroots, fp));
|
||||
}
|
||||
if (ptr != NULL) {
|
||||
ptr = next_token(&args, " \t");
|
||||
if (ptr != NULL)
|
||||
goto nextview;
|
||||
}
|
||||
ptr = next_token(&args, " \t");
|
||||
} while (ptr != NULL);
|
||||
|
||||
cleanup:
|
||||
if (secroots != NULL)
|
||||
|
Reference in New Issue
Block a user