4031. [bug] named-checkconf -z failed to report a missing file
with a hint zone. [RT #38294]
This commit is contained in:
@@ -211,7 +211,7 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
|
||||
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone,
|
||||
rdclass, 0, NULL, &db);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
goto failure;
|
||||
|
||||
len = strlen(root_ns);
|
||||
isc_buffer_init(&source, root_ns, len);
|
||||
@@ -220,7 +220,7 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
|
||||
dns_rdatacallbacks_init(&callbacks);
|
||||
result = dns_db_beginload(db, &callbacks);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
goto failure;
|
||||
if (filename != NULL) {
|
||||
/*
|
||||
* Load the hints from the specified filename.
|
||||
@@ -243,7 +243,7 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
|
||||
if (result == ISC_R_SUCCESS || result == DNS_R_SEENINCLUDE)
|
||||
result = eresult;
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE)
|
||||
goto db_detach;
|
||||
goto failure;
|
||||
if (check_hints(db) != ISC_R_SUCCESS)
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING,
|
||||
@@ -252,8 +252,14 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
|
||||
*target = db;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
db_detach:
|
||||
dns_db_detach(&db);
|
||||
failure:
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS,
|
||||
ISC_LOG_ERROR, "could not configure root hints from "
|
||||
"'%s': %s", (filename != NULL) ? filename : "<BUILT-IN>",
|
||||
isc_result_totext(result));
|
||||
|
||||
if (db != NULL)
|
||||
dns_db_detach(&db);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user