From: Mark Andrews Date: Mon, 28 Aug 2023 01:53:21 +0000 (+1000) Subject: rr_exists should not error if the name does not exist X-Git-Tag: v9.19.17~28^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b76a15977a5c3f0a7031194ebcce91617c4f03e4;p=thirdparty%2Fbind9.git rr_exists should not error if the name does not exist 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. --- diff --git a/lib/ns/update.c b/lib/ns/update.c index 390c97e1677..7be4f641fb8 100644 --- a/lib/ns/update.c +++ b/lib/ns/update.c @@ -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);