]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Thu, 22 Feb 2001 19:33:14 +0000 (19:33 +0000)
committerAndreas Gustafsson <source@isc.org>
Thu, 22 Feb 2001 19:33:14 +0000 (19:33 +0000)
 747.   [bug]           The code to determine whether an IXFR was possible
                        did not properly check for a database that could
                        not have a journal. [RT #908]

CHANGES
bin/named/update.c
bin/named/xfrout.c

diff --git a/CHANGES b/CHANGES
index 01cd6d6f6fd0a8bf38a1d698006beeef64197442..28d6204f6a0163ab8061cdcee2786b968e6ad675 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,8 @@
 
+ 747.  [bug]           The code to determine whether an IXFR was possible
+                       did not properly check for a database that could
+                       not have a journal. [RT #908]
+
  746.  [bug]           The sdb didn't clone rdatasets properly, causing
                        a crash when the server followed delegations. [RT #905]
 
index 226cecf5e7c9250837cf1c783d9ad86cceac8bb3..15f8ad2880465f75877bcd2b1750204925fe2d04 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: update.c,v 1.79.2.2 2001/02/15 19:39:09 gson Exp $ */
+/* $Id: update.c,v 1.79.2.3 2001/02/22 19:33:12 gson Exp $ */
 
 #include <config.h>
 
@@ -2356,6 +2356,7 @@ update_action(isc_task_t *task, isc_event_t *event) {
         * to the journal.
         */
        if (! ISC_LIST_EMPTY(diff.tuples)) {
+               char *journalfile;
                dns_journal_t *journal;
 
                /*
@@ -2380,22 +2381,25 @@ update_action(isc_task_t *task, isc_event_t *event) {
                        }
                }
 
-               isc_log_write(UPDATE_DEBUG_LOGARGS, "writing journal %s",
-                             dns_zone_getjournal(zone));
+               journalfile = dns_zone_getjournal(zone);
+               if (journalfile != NULL) {
+                       isc_log_write(UPDATE_DEBUG_LOGARGS,
+                                     "writing journal %s", journalfile);
 
-               journal = NULL;
-               result = dns_journal_open(mctx, dns_zone_getjournal(zone),
-                                         ISC_TRUE, &journal);
-               if (result != ISC_R_SUCCESS)
-                       FAILS(result, "journal open failed");
+                       journal = NULL;
+                       result = dns_journal_open(mctx, journalfile,
+                                                 ISC_TRUE, &journal);
+                       if (result != ISC_R_SUCCESS)
+                               FAILS(result, "journal open failed");
+
+                       result = dns_journal_write_transaction(journal, &diff);
+                       if (result != ISC_R_SUCCESS) {
+                               dns_journal_destroy(&journal);
+                               FAILS(result, "journal write failed");
+                       }
 
-               result = dns_journal_write_transaction(journal, &diff);
-               if (result != ISC_R_SUCCESS) {
                        dns_journal_destroy(&journal);
-                       FAILS(result, "journal write failed");
                }
-
-               dns_journal_destroy(&journal);
        }
 
        /*
index 3976c6944a56b8d4d2863217cf9a6bb29e6f4801..80d26e34fbd96c74e05b6dd3ffe9eeee17895123 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: xfrout.c,v 1.87.2.5 2001/01/12 20:33:17 bwelling Exp $ */
+/* $Id: xfrout.c,v 1.87.2.6 2001/02/22 19:33:14 gson Exp $ */
 
 #include <config.h>
 
@@ -865,6 +865,7 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
        isc_netaddr_t na;
        dns_peer_t *peer = NULL;
        isc_buffer_t *tsigbuf = NULL;
+       char *journalfile;
 
        switch (reqtype) {
        case dns_rdatatype_axfr:
@@ -1048,11 +1049,15 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
                        CHECK(soa_rrstream_create(mctx, db, ver, &stream));
                        goto have_stream;
                }
-               result = ixfr_rrstream_create(mctx,
-                                             dns_zone_getjournal(zone),
-                                             begin_serial,
-                                             current_serial,
-                                             &data_stream);
+               journalfile = dns_zone_getjournal(zone);
+               if (journalfile != NULL)
+                       result = ixfr_rrstream_create(mctx,
+                                                     journalfile,
+                                                     begin_serial,
+                                                     current_serial,
+                                                     &data_stream);
+               else
+                       result = ISC_R_NOTFOUND;
                if (result == ISC_R_NOTFOUND ||
                    result == ISC_R_RANGE) {
                        xfrout_log1(client, question_name, ISC_LOG_DEBUG(4),