mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-25 20:38:36 +00:00
Fix hostname_issubdomain() confusion.
commit1269f074f8broke hostname_issubdomain() and then accidentally fixed some of the problems by inverting the argument order in the new uses of the function it introduced. All the pre-existing calls to hostname_issubdomain() were left in a non-working state. This fixes hostname_issubdomain() back to the state before1269f074f8, adds some logic to give correct answers when comparing to the root domain, and gets right the new calls to hostname_issubdomain() added in1269f074f8Thanks to Jean Thomas for spotting this problem.
This commit is contained in:
2 files changed
+13
-10
No files matched your search
+3
-3
@@ -383,7 +383,7 @@ static int explore_rrset(struct dns_header *header, size_t plen, int class, int
|
||||
an attacker using signatures made with the key of an unrelated
|
||||
zone he controls. Note that the root key is always allowed.
|
||||
Ignore sigs which aren't valid */
|
||||
if (*daemon->workspacename == 0 || hostname_issubdomain(name, daemon->workspacename) != 0)
|
||||
if (*daemon->workspacename == 0 || hostname_issubdomain(daemon->workspacename, name) != 0)
|
||||
{
|
||||
if (gotkey)
|
||||
{
|
||||
@@ -2095,8 +2095,8 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
|
||||
CNAME must be <subdomain>.<dname>
|
||||
CNAME target must be <subdomain>.<dname_target>
|
||||
<subdomain>s must match for name and target. */
|
||||
if (hostname_issubdomain(daemon->cname, name) == 1 &&
|
||||
hostname_issubdomain(daemon->workspacename, keyname) == 1 &&
|
||||
if (hostname_issubdomain(name, daemon->cname) == 1 &&
|
||||
hostname_issubdomain(keyname, daemon->workspacename) == 1 &&
|
||||
name_prefix_len == strlen(daemon->workspacename) - strlen(keyname))
|
||||
{
|
||||
char save = daemon->cname[name_prefix_len];
|
||||
|
||||
Reference in new issue
Block a user