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.

(cherry picked from commit b76a15977a)
This commit is contained in:
Mark Andrews
2023-08-28 11:53:21 +10:00
parent b4694e7551
commit 58be5d8ed0

View File

@@ -2219,9 +2219,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 {
CHECK(dns_db_findnode(db, name, false, &node));
result = dns_db_findnode(db, name, false, &node);
}
if (result == ISC_R_NOTFOUND) {
*flag = false;
result = ISC_R_SUCCESS;
goto failure;
} else {
CHECK(result);
}
result = dns_db_findrdataset(db, node, ver, rdata->type, 0,
(isc_stdtime_t)0, &rdataset, NULL);