]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3023. [bug] Named could be left in an inconsistent state when
authorEvan Hunt <each@isc.org>
Fri, 18 Feb 2011 21:22:12 +0000 (21:22 +0000)
committerEvan Hunt <each@isc.org>
Fri, 18 Feb 2011 21:22:12 +0000 (21:22 +0000)
receiving multiple AXFR response messages that were
not all TSIG-signed. [RT #23254]

CHANGES
lib/dns/xfrin.c

diff --git a/CHANGES b/CHANGES
index 75c5b18ee40d469d3ab80b0bea6e063c9a2abf17..addb767697a6da0ea7e607bc0fc35699b15e6c57 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3023.  [bug]           Named could be left in an inconsistent state when
+                       receiving multiple AXFR response messages that were
+                       not all TSIG-signed. [RT #23254]
+
 3022.  [bug]           Fixed prz SERVFAILs after failed zone transfers
                         [RT #23246]
 
index 4e3d2c36f1f752ba821aaa1137fce86d6311f265..0a5329f58d042379c13edd9a561dfd452c2fe63d 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: xfrin.c,v 1.166 2008/09/25 04:12:39 marka Exp $ */
+/* $Id: xfrin.c,v 1.167 2011/02/18 21:22:12 each Exp $ */
 
 /*! \file */
 
@@ -203,6 +203,7 @@ static isc_result_t axfr_putdata(dns_xfrin_ctx_t *xfr, dns_diffop_t op,
                                   dns_rdata_t *rdata);
 static isc_result_t axfr_apply(dns_xfrin_ctx_t *xfr);
 static isc_result_t axfr_commit(dns_xfrin_ctx_t *xfr);
+static isc_result_t axfr_finalize(dns_xfrin_ctx_t *xfr);
 
 static isc_result_t ixfr_init(dns_xfrin_ctx_t *xfr);
 static isc_result_t ixfr_apply(dns_xfrin_ctx_t *xfr);
@@ -318,6 +319,16 @@ axfr_commit(dns_xfrin_ctx_t *xfr) {
 
        CHECK(axfr_apply(xfr));
        CHECK(dns_db_endload(xfr->db, &xfr->axfr.add_private));
+
+       result = ISC_R_SUCCESS;
+ failure:
+       return (result);
+}
+
+static isc_result_t
+axfr_finalize(dns_xfrin_ctx_t *xfr) {
+       isc_result_t result;
+
        CHECK(dns_zone_replacedb(xfr->zone, xfr->db, ISC_TRUE));
 
        result = ISC_R_SUCCESS;
@@ -1350,6 +1361,8 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
                xfr->state = XFRST_INITIALSOA;
                CHECK(xfrin_send_request(xfr));
        } else if (xfr->state == XFRST_END) {
+               CHECK(axfr_finalize(xfr));
+
                /*
                 * Close the journal.
                 */