From 58be5d8ed01c02f2a7a7dd88b916fffba30a3eea Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 28 Aug 2023 11:53:21 +1000 Subject: [PATCH] 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 b76a15977a5c3f0a7031194ebcce91617c4f03e4) --- lib/ns/update.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/ns/update.c b/lib/ns/update.c index 7e8191958c..983ca84e26 100644 --- a/lib/ns/update.c +++ b/lib/ns/update.c @@ -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);