]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
rr_exists should not error if the name does not exist
authorMark Andrews <marka@isc.org>
Mon, 28 Aug 2023 01:53:21 +0000 (11:53 +1000)
committerMark Andrews <marka@isc.org>
Tue, 29 Aug 2023 14:48:50 +0000 (00:48 +1000)
rr_exists errored if the name did not exist in the zone.  This was
not an issue prior to the addition of krb5-subdomain-self-rhs and
ms-subdomain-self-rhs as the only name used was the zone name which
always existed.

lib/ns/update.c

index 390c97e1677fb51f8ddcedd2a288f543735388a7..7be4f641fb86d65f735a41e3ae16eb32f6576d2d 100644 (file)
@@ -2218,9 +2218,16 @@ rr_exists(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
 
        dns_rdataset_init(&rdataset);
        if (rdata->type == dns_rdatatype_nsec3) {
-               CHECK(dns_db_findnsec3node(db, name, false, &node));
+               result = dns_db_findnsec3node(db, name, false, &node);
+       } else {
+               result = dns_db_findnode(db, name, false, &node);
+       }
+       if (result == ISC_R_NOTFOUND) {
+               *flag = false;
+               result = ISC_R_SUCCESS;
+               goto failure;
        } else {
-               CHECK(dns_db_findnode(db, name, false, &node));
+               CHECK(result);
        }
        result = dns_db_findrdataset(db, node, ver, rdata->type, 0,
                                     (isc_stdtime_t)0, &rdataset, NULL);