From b326d7e3a3a50eb65dd06db007d2fddc62606bbf Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 14 Mar 2005 23:55:57 +0000 Subject: [PATCH] 1795. [bug] "rndc dumpb" was not fully documented. Minor formating issues with "rndc dumpdb -all". [RT #13396] --- CHANGES | 3 ++- bin/named/server.c | 27 +++++++++++++++++++++++---- bin/rndc/rndc.c | 5 +++-- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 9188b26b1f..ec1bfcce2d 100644 --- a/CHANGES +++ b/CHANGES @@ -64,7 +64,8 @@ 1796. [func] "rndc freeze/thaw" now freezes/thaws all zones. -1795. [placeholder] rt13396 +1795. [bug] "rndc dumpb" was not fully documented. Minor + formating issues with "rndc dumpdb -all". [RT #13396] 1794. [func] Named and named-checkzone can now both check for non-terminal wildcard records. diff --git a/bin/named/server.c b/bin/named/server.c index 62394c121b..34112712c5 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.438 2005/01/17 00:46:01 marka Exp $ */ +/* $Id: server.c,v 1.439 2005/03/14 23:55:56 marka Exp $ */ #include @@ -3714,6 +3714,15 @@ add_view_tolist(struct dumpcontext *dctx, dns_view_t *view) { struct viewlistentry *vle; isc_result_t result = ISC_R_SUCCESS; + /* + * Prevent duplicate views. + */ + for (vle = ISC_LIST_HEAD(dctx->viewlist); + vle != NULL; + vle = ISC_LIST_NEXT(vle, link)) + if (vle->view == view) + return (ISC_R_SUCCESS); + vle = isc_mem_get(dctx->mctx, sizeof *vle); if (vle == NULL) return (ISC_R_NOMEMORY); @@ -3777,9 +3786,11 @@ dumpdone(void *arg, isc_result_t result) { if (dctx->view == NULL) goto done; INSIST(dctx->zone == NULL); - } + } else + goto resume; nextview: fprintf(dctx->fp, ";\n; Start view %s\n;\n", dctx->view->view->name); + resume: if (dctx->zone == NULL && dctx->cache == NULL && dctx->dumpcache) { style = &dns_master_style_cache; /* start cache dump */ @@ -3840,9 +3851,12 @@ dumpdone(void *arg, isc_result_t result) { &dctx->mdctx); if (result == DNS_R_CONTINUE) return; - if (result == ISC_R_NOTIMPLEMENTED) + if (result == ISC_R_NOTIMPLEMENTED) { fprintf(dctx->fp, "; %s\n", dns_result_totext(result)); + result = ISC_R_SUCCESS; + goto nextzone; + } if (result != ISC_R_SUCCESS) goto cleanup; } @@ -3866,7 +3880,6 @@ dumpdone(void *arg, isc_result_t result) { dumpcontext_destroy(dctx); } - isc_result_t ns_server_dumpdb(ns_server_t *server, char *args) { struct dumpcontext *dctx = NULL; @@ -3922,6 +3935,7 @@ ns_server_dumpdb(ns_server_t *server, char *args) { ptr = next_token(&args, " \t"); } + nextview: for (view = ISC_LIST_HEAD(server->viewlist); view != NULL; view = ISC_LIST_NEXT(view, link)) @@ -3930,6 +3944,11 @@ ns_server_dumpdb(ns_server_t *server, char *args) { continue; CHECK(add_view_tolist(dctx, view)); } + if (ptr != NULL) { + ptr = next_token(&args, " \t"); + if (ptr != NULL) + goto nextview; + } dumpdone(dctx, ISC_R_SUCCESS); return (ISC_R_SUCCESS); diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c index ebe7304acf..9212e1f394 100644 --- a/bin/rndc/rndc.c +++ b/bin/rndc/rndc.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc.c,v 1.103 2005/02/23 01:06:36 marka Exp $ */ +/* $Id: rndc.c,v 1.104 2005/03/14 23:55:57 marka Exp $ */ /* * Principal Author: DCL @@ -111,7 +111,8 @@ command is one of the following:\n\ reconfig Reload configuration file and new zones only.\n\ stats Write server statistics to the statistics file.\n\ querylog Toggle query logging.\n\ - dumpdb Dump cache(s) to the dump file (named_dump.db).\n\ + dumpdb [-all|-cache|-zones] [view ...]\n\ + Dump cache(s) to the dump file (named_dump.db).\n\ stop Save pending updates to master files and stop the server.\n\ stop -p Save pending updates to master files and stop the server\n\ reporting process id.\n\