Skip to content

Fix use of incorrect method when resolving CNAMES#54

Open
jeteon wants to merge 1 commit into
TheRook:masterfrom
jeteon:patch-3
Open

Fix use of incorrect method when resolving CNAMES#54
jeteon wants to merge 1 commit into
TheRook:masterfrom
jeteon:patch-3

Conversation

@jeteon
Copy link
Copy Markdown

@jeteon jeteon commented Feb 7, 2017

When checking CNAME records, the code calls:

self.resolver.query(cname_host, "A", total_rechecks)

Which results in an integer argument being given for the name_server argument in the resolver.query method which has the signature:

def query(self, hostname, query_type = 'ANY', name_server = False, use_tcp = False):

And causes an error to be raised in dnslib:

File "dnslib/dns.py", line 375, in send
    sock.sendto(self.pack(),(dest,port))
TypeError: coercing to Unicode: need string or buffer, int found

It seems from the call signature intended to be recursive call to the check method itself with a preservation of the retry count so that's what I put in.

When checking `CNAME` records, the code calls:
```
self.resolver.query(cname_host, "A", total_rechecks)
```

Which results in an integer argument being given for the `name_server` argument in the `resolver.query` method which has the signature:
```
def query(self, hostname, query_type = 'ANY', name_server = False, use_tcp = False):
```
And causes an error to be raised in `dnslib`:
```
 File "dnslib/dns.py", line 375, in send
    sock.sendto(self.pack(),(dest,port))
TypeError: coercing to Unicode: need string or buffer, int found
```

It seems from the call signature intended to be recursive call to the `check` method itself with a preservation of the retry count so that's what I put in.
@jeteon jeteon changed the title Fix use of incorrect method Fix use of incorrect method when resolving CNAMES Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant