]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
query_getzonedb can returns DNS_R_EXPIRED
authorColin Vidal <colin@isc.org>
Fri, 31 Oct 2025 11:15:00 +0000 (12:15 +0100)
committerColin Vidal <colin@isc.org>
Mon, 3 Nov 2025 16:34:25 +0000 (17:34 +0100)
If `query_getzonedb()` finds a zone but the zone is expired it
immediately returns `DNS_R_EXPIRED` and doesn't attempt to get the zone
DB (which would be NULL in this case).

This enable caller to have a more precise reason of why getting the DB
has failed.

lib/ns/query.c

index 9f59e9a577f8f608649f80b533ad002341bccdfe..b9bd2b892a69e13e6b024a104de6f9a5565f1b27 100644 (file)
@@ -1250,6 +1250,11 @@ query_getzonedb(ns_client_t *client, const dns_name_t *name,
                partial = true;
        }
        if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
+               if (dns_zone_isexpired(zone)) {
+                       result = DNS_R_EXPIRED;
+                       goto fail;
+               }
+
                result = dns_zone_getdb(zone, &db);
        }