diff --git a/CHANGES b/CHANGES index 0e941f4c1a..3271d9437d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -1722. [placeholder] rt12519 +1722. [bug] Don't commit the journal on malformed ixfr streams. + [RT #12519] -1721. [placeholder] rt12519 +1721. [bug] Error message from the journal processing were not + always identifing the relevent journal. [RT #12519] 1720. [bug] 'dig +chase' did not terminate on a RFC 2308 Type 1 negative response. [RT #12506] diff --git a/lib/dns/journal.c b/lib/dns/journal.c index 5930af4fe0..b2b0306b7f 100644 --- a/lib/dns/journal.c +++ b/lib/dns/journal.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: journal.c,v 1.88 2004/05/14 05:08:00 marka Exp $ */ +/* $Id: journal.c,v 1.89 2004/09/16 04:54:03 marka Exp $ */ #include @@ -1035,8 +1035,8 @@ dns_journal_commit(dns_journal_t *j) { */ if (j->x.n_soa != 2) { isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, - "malformed transaction: %d SOAs", - j->x.n_soa); + "%s: malformed transaction: %d SOAs", + j->filename, j->x.n_soa); return (ISC_R_UNEXPECTED); } if (! (DNS_SERIAL_GT(j->x.pos[1].serial, j->x.pos[0].serial) || @@ -1044,8 +1044,8 @@ dns_journal_commit(dns_journal_t *j) { j->x.pos[1].serial == j->x.pos[0].serial))) { isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, - "malformed transaction: serial number " - "would decrease"); + "%s: malformed transaction: serial number " + "would decrease", j->filename); return (ISC_R_UNEXPECTED); } if (! JOURNAL_EMPTY(&j->header)) { @@ -1266,8 +1266,8 @@ roll_forward(dns_journal_t *j, dns_db_t *db) { if (++n_put > 100) { isc_log_write(JOURNAL_DEBUG_LOGARGS(3), - "applying diff to database (%u)", - db_serial); + "%s: applying diff to database (%u)", + j->filename, db_serial); (void)dns_diff_print(&diff, NULL); CHECK(dns_diff_apply(&diff, db, ver)); dns_diff_clear(&diff); @@ -1280,8 +1280,8 @@ roll_forward(dns_journal_t *j, dns_db_t *db) { if (n_put != 0) { isc_log_write(JOURNAL_DEBUG_LOGARGS(3), - "applying final diff to database (%u)", - db_serial); + "%s: applying final diff to database (%u)", + j->filename, db_serial); (void)dns_diff_print(&diff, NULL); CHECK(dns_diff_apply(&diff, db, ver)); dns_diff_clear(&diff); @@ -1352,7 +1352,8 @@ dns_journal_print(isc_mem_t *mctx, const char *filename, FILE *file) { if (result != ISC_R_SUCCESS) { isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, - "journal open failure"); + "journal open failure: %s: %s", + isc_result_totext(result), j->filename); return (result); } @@ -1545,7 +1546,8 @@ read_one_rr(dns_journal_t *j) { CHECK(journal_read_xhdr(j, &xhdr)); if (xhdr.size == 0) { isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, - "journal corrupt: empty transaction"); + "%s: journal corrupt: empty transaction", + j->filename); FAIL(ISC_R_UNEXPECTED); } if (xhdr.serial0 != j->it.current_serial) { diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 88d20a4f9e..efd5090d76 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: xfrin.c,v 1.136 2004/06/27 10:10:55 jakob Exp $ */ +/* $Id: xfrin.c,v 1.137 2004/09/16 04:54:03 marka Exp $ */ #include @@ -500,8 +500,8 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl, case XFRST_IXFR_ADD: if (rdata->type == dns_rdatatype_soa) { isc_uint32_t soa_serial = dns_soa_getserial(rdata); - CHECK(ixfr_commit(xfr)); if (soa_serial == xfr->end_serial) { + CHECK(ixfr_commit(xfr)); xfr->state = XFRST_END; break; } else if (soa_serial != xfr->ixfr.current_serial) { @@ -511,6 +511,7 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl, xfr->ixfr.current_serial, soa_serial); FAIL(DNS_R_FORMERR); } else { + CHECK(ixfr_commit(xfr)); xfr->state = XFRST_IXFR_DELSOA; goto redo; }