2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 06:55:30 +00:00

only allow glue for the delegating zone

This commit is contained in:
Bob Halley
1999-09-08 01:21:01 +00:00
parent 7f9096e4c9
commit 6674b5827d

View File

@@ -122,6 +122,7 @@ query_reset(ns_client_t *client, isc_boolean_t everything) {
client->query.qname = NULL; client->query.qname = NULL;
client->query.origqname = NULL; client->query.origqname = NULL;
client->query.dboptions = 0; client->query.dboptions = 0;
client->query.gluedb = NULL;
} }
static void static void
@@ -366,6 +367,7 @@ query_simplefind(void *arg, dns_name_t *name, dns_rdatatype_t type,
dns_fixedname_t foundname; dns_fixedname_t foundname;
dns_db_t *db; dns_db_t *db;
dns_dbversion_t *version; dns_dbversion_t *version;
unsigned int dboptions;
REQUIRE(NS_CLIENT_VALID(client)); REQUIRE(NS_CLIENT_VALID(client));
@@ -391,7 +393,10 @@ query_simplefind(void *arg, dns_name_t *name, dns_rdatatype_t type,
* Now look for an answer in the database. * Now look for an answer in the database.
*/ */
dns_fixedname_init(&foundname); dns_fixedname_init(&foundname);
result = dns_db_find(db, name, version, type, client->query.dboptions, dboptions = client->query.dboptions;
if (db == client->query.gluedb)
dboptions |= DNS_DBFIND_GLUEOK;
result = dns_db_find(db, name, version, type, dboptions,
client->requesttime, NULL, client->requesttime, NULL,
dns_fixedname_name(&foundname), dns_fixedname_name(&foundname),
rdataset, sigrdataset); rdataset, sigrdataset);
@@ -443,6 +448,7 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t type) {
isc_buffer_t *dbuf; isc_buffer_t *dbuf;
isc_buffer_t b; isc_buffer_t b;
dns_dbversion_t *version; dns_dbversion_t *version;
unsigned int dboptions;
REQUIRE(NS_CLIENT_VALID(client)); REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(type != dns_rdatatype_any); REQUIRE(type != dns_rdatatype_any);
@@ -497,7 +503,10 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t type) {
* Now look for an answer in the database. * Now look for an answer in the database.
*/ */
node = NULL; node = NULL;
result = dns_db_find(db, name, version, type, client->query.dboptions, dboptions = client->query.dboptions;
if (db == client->query.gluedb)
dboptions |= DNS_DBFIND_GLUEOK;
result = dns_db_find(db, name, version, type, dboptions,
client->requesttime, &node, fname, rdataset, client->requesttime, &node, fname, rdataset,
sigrdataset); sigrdataset);
switch (result) { switch (result) {
@@ -1002,7 +1011,6 @@ query_find(ns_client_t *client) {
isc_result_t result, eresult; isc_result_t result, eresult;
dns_fixedname_t fixed; dns_fixedname_t fixed;
dns_dbversion_t *version; dns_dbversion_t *version;
unsigned int dboptions;
/* /*
* One-time initialization. * One-time initialization.
@@ -1176,15 +1184,14 @@ query_find(ns_client_t *client) {
* We don't have a cache, so this is the best * We don't have a cache, so this is the best
* answer. * answer.
* *
* We enable the retrieval of glue so we can * We enable the retrieval of glue for this
* put it into the additional data section. * database by setting client->query.gluedb.
*/ */
dboptions = client->query.dboptions; client->query.gluedb = db;
client->query.dboptions |= DNS_DBFIND_GLUEOK;
query_addrrset(client, &fname, &rdataset, query_addrrset(client, &fname, &rdataset,
&sigrdataset, dbuf, &sigrdataset, dbuf,
DNS_SECTION_AUTHORITY); DNS_SECTION_AUTHORITY);
client->query.dboptions = dboptions; client->query.gluedb = NULL;
} else { } else {
/* /*
* We might have a better answer or delegation * We might have a better answer or delegation