diff --git a/CHANGES b/CHANGES index d7aad1fa82..383094f897 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 4267. [test] Check sdlz error handling. [RT #41142] -4266. [placeholder] +4266. [bug] The sdlz driver failed pass some errors back to the + caller. [RT #41142] 4265. [bug] Address unchecked isc_mem_get calls. [RT #41187] diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 3b245419d0..e705320217 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -606,7 +606,7 @@ findnodeext(dns_db_t *db, dns_name_t *name, isc_boolean_t create, * if the host (namestr) was not found, try to lookup a * "wildcard" host. */ - if (result != ISC_R_SUCCESS && !create) + if (result == ISC_R_NOTFOUND && !create) result = sdlz->dlzimp->methods->lookup(zonestr, "*", sdlz->dlzimp->driverarg, sdlz->dbdata, node, @@ -614,7 +614,10 @@ findnodeext(dns_db_t *db, dns_name_t *name, isc_boolean_t create, MAYBE_UNLOCK(sdlz->dlzimp); - if (result != ISC_R_SUCCESS && !isorigin && !create) { + if (result == ISC_R_NOTFOUND && (isorigin || create)) + result = ISC_R_SUCCESS; + + if (result != ISC_R_SUCCESS) { destroynode(node); return (result); } @@ -879,10 +882,11 @@ findext(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, dns_name_getlabelsequence(name, nlabels - i, i, xname); result = findnodeext(db, xname, ISC_FALSE, methods, clientinfo, &node); - if (result != ISC_R_SUCCESS) { + if (result == ISC_R_NOTFOUND) { result = DNS_R_NXDOMAIN; continue; - } + } else if (result != ISC_R_SUCCESS) + break; /* * Look for a DNAME at the current label, unless this is