From 1ae892f54dec6cfceb0252c22a6860e6f337892a Mon Sep 17 00:00:00 2001 From: Alessio Podda Date: Thu, 29 Jan 2026 09:56:24 +0100 Subject: [PATCH] Handle databases with no update methods Non qp/rbt databases might not implement the dns_db_(begin|commit|abort)update methods. This commit ensures that we return ISC_R_NOTIMPLEMENTED in those cases. --- lib/dns/include/dns/db.h | 3 ++- lib/dns/xfrin.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h index c703a60176..f2af1756c5 100644 --- a/lib/dns/include/dns/db.h +++ b/lib/dns/include/dns/db.h @@ -603,7 +603,8 @@ isc_result_t dns_db_abortupdate(dns_db_t *db, dns_rdatacallbacks_t *callbacks); /*%< * Abort the update to 'db'. Must be safe to double-call or call after - * dns_db_commitupdate. + * dns_db_commitupdate. Must also be safe to call without having called + * dns_db_beginupdate first. * * Requires: * diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 9d6e7882d1..af717462ca 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -538,7 +538,7 @@ ixfr_apply_one(dns_xfrin_t *xfr, ixfr_apply_data_t *data) { * So we need to commit *before* calling dns_zone_verifydb, and rely * on closeversion to actually do cleanup. */ - dns_db_commitupdate(xfr->db, &callbacks); + CHECK(dns_db_commitupdate(xfr->db, &callbacks)); CHECK(dns_zone_verifydb(xfr->zone, xfr->db, xfr->ver)); @@ -550,7 +550,7 @@ cleanup: * For the reason stated above, dns_db_abortupdate must *commit* the * changes and rely on closeversion to clean them up. */ - dns_db_abortupdate(xfr->db, &callbacks); + (void)dns_db_abortupdate(xfr->db, &callbacks); /* We need to end the transaction, but keep the previous error */ (void)ixfr_end_transaction(&xfr->ixfr);