]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle databases with no update methods
authorAlessio Podda <alessio@isc.org>
Thu, 29 Jan 2026 08:56:24 +0000 (09:56 +0100)
committerAlessio Podda <alessio@isc.org>
Mon, 2 Feb 2026 09:32:38 +0000 (10:32 +0100)
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
lib/dns/xfrin.c

index c703a601763268f3757f53d502c8e90ce900b017..f2af1756c50f2c9350f230ac1f47d648a41bb99d 100644 (file)
@@ -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:
  *
index 9d6e7882d1ccf09bb0477f836ddca0a6dea699ae..af717462ca747675864e044a20536236af6b2364 100644 (file)
@@ -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);