]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1795. [bug] "rndc dumpb" was not fully documented. Minor
authorMark Andrews <marka@isc.org>
Mon, 14 Mar 2005 23:55:57 +0000 (23:55 +0000)
committerMark Andrews <marka@isc.org>
Mon, 14 Mar 2005 23:55:57 +0000 (23:55 +0000)
                        formating issues with "rndc dumpdb -all".  [RT #13396]

CHANGES
bin/named/server.c
bin/rndc/rndc.c

diff --git a/CHANGES b/CHANGES
index 9188b26b1f6b740a22938f29a00cbf0468271d99..ec1bfcce2dc2ad184446dbfb3d4c60948bf8d9c5 100644 (file)
--- 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.
index 62394c121b22dfb928194458492d72e8e0332e57..34112712c5457f7249b87fd465abe536c5761fc1 100644 (file)
@@ -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 <config.h>
 
@@ -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);
 
index ebe7304acf76644570435d0dd05840c77d3b172c..9212e1f394b335001b58eb77cc928615e14754cb 100644 (file)
@@ -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\