Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
64024eaa
Commit
64024eaa
authored
Jul 15, 2000
by
Andreas Gustafsson
Browse files
333. [bug] The resolver incorrectly accepted referrals to
subdomains of the query domain, causing an assertion failure.
parent
5fff4f8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
64024eaa
333. [bug] The resolver incorrectly accepted referrals to
subdomains of the query domain, causing an
assertion failure.
332. [func] New function dns_name_reset().
331. [bug] Only log "recursion denied" if RD is set. (RT #178)
...
...
lib/dns/resolver.c
View file @
64024eaa
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: resolver.c,v 1.14
7
2000/07/1
4
0
0:37
:2
7
gson Exp $ */
/* $Id: resolver.c,v 1.14
8
2000/07/1
5
0
1:02
:2
5
gson Exp $ */
#include <config.h>
...
...
@@ -2982,6 +2982,31 @@ dname_target(dns_rdataset_t *rdataset, dns_name_t *qname, dns_name_t *oname,
return
(
dns_name_concatenate
(
dname
,
&
tname
,
dname
,
NULL
));
}
/* XXXAG should be public function in name.c */
static
isc_boolean_t
dns_name_ispropersubdomain
(
const
dns_name_t
*
name1
,
const
dns_name_t
*
name2
)
{
int
order
;
unsigned
int
nlabels
,
nbits
;
dns_namereln_t
namereln
;
/*
* Is 'name1' a proper subdomain of 'name2'?
*
* Note: It makes no sense for one of the names to be relative and the
* other absolute. If both names are relative, then to be meaningfully
* compared the caller must ensure that they are both relative to the
* same domain.
*/
namereln
=
dns_name_fullcompare
(
name1
,
name2
,
&
order
,
&
nlabels
,
&
nbits
);
if
(
namereln
==
dns_namereln_subdomain
)
return
(
ISC_TRUE
);
return
(
ISC_FALSE
);
}
static
isc_result_t
noanswer_response
(
fetchctx_t
*
fctx
,
dns_name_t
*
oqname
)
{
isc_result_t
result
;
...
...
@@ -3154,6 +3179,17 @@ noanswer_response(fetchctx_t *fctx, dns_name_t *oqname) {
*/
if
(
dns_name_equal
(
ns_name
,
&
fctx
->
domain
))
return
(
DNS_R_FORMERR
);
/*
* If the referral name is below the query name,
* we are making too much progress, overshooting
* the target. Consider the responder insane.
*/
if
(
dns_name_ispropersubdomain
(
ns_name
,
&
fctx
->
name
))
{
FCTXTRACE
(
"referral name below query name"
);
return
(
DNS_R_FORMERR
);
}
/*
* Mark any additional data related to this rdataset.
* It's important that we do this before we change the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment