From e1d3de3e173e2e1b31cfe0c7e8483eb205f4bb2d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Dec 2010 02:31:40 +0100 Subject: dnspython: Merge in new upstream. Autobuild-User: Jelmer Vernooij Autobuild-Date: Mon Dec 20 03:21:52 CET 2010 on sn-devel-104 --- lib/dnspython/ChangeLog | 12 ++++++++++++ lib/dnspython/dns/message.py | 2 +- lib/dnspython/dns/rdata.py | 4 ++++ lib/dnspython/dns/resolver.py | 8 ++++++++ lib/dnspython/dns/version.py | 2 +- lib/dnspython/setup.py | 2 +- 6 files changed, 27 insertions(+), 3 deletions(-) (limited to 'lib/dnspython') diff --git a/lib/dnspython/ChangeLog b/lib/dnspython/ChangeLog index 91e69d3ea2..0fff77f977 100644 --- a/lib/dnspython/ChangeLog +++ b/lib/dnspython/ChangeLog @@ -1,3 +1,15 @@ +2010-12-17 Bob Halley + + * dns/message.py (_WireReader._get_section): use "is" and not "==" + when testing what section an RR is in. Thanks to James Raftery + for reporting this bug. + +2010-12-10 Bob Halley + + * dns/resolver.py (Resolver.query): disallow metaqueries. + + * dns/rdata.py (Rdata.__hash__): Added a __hash__ method for rdata. + 2010-11-23 Bob Halley * (Version 1.9.2 released) diff --git a/lib/dnspython/dns/message.py b/lib/dnspython/dns/message.py index 5ec711e1eb..a124a3e177 100644 --- a/lib/dnspython/dns/message.py +++ b/lib/dnspython/dns/message.py @@ -686,7 +686,7 @@ class _WireReader(object): deleting = None if deleting == dns.rdataclass.ANY or \ (deleting == dns.rdataclass.NONE and \ - section == self.message.answer): + section is self.message.answer): covers = dns.rdatatype.NONE rd = None else: diff --git a/lib/dnspython/dns/rdata.py b/lib/dnspython/dns/rdata.py index ce0268697b..399677e984 100644 --- a/lib/dnspython/dns/rdata.py +++ b/lib/dnspython/dns/rdata.py @@ -28,6 +28,7 @@ chunk of hexstring that _hexify() produces before whitespace occurs. import cStringIO import dns.exception +import dns.name import dns.rdataclass import dns.rdatatype import dns.tokenizer @@ -252,6 +253,9 @@ class Rdata(object): return NotImplemented return self._cmp(other) > 0 + def __hash__(self): + return hash(self.to_digestable(dns.name.root)) + def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True): """Build an rdata object from text format. diff --git a/lib/dnspython/dns/resolver.py b/lib/dnspython/dns/resolver.py index f803eb6d20..30977f3a8b 100644 --- a/lib/dnspython/dns/resolver.py +++ b/lib/dnspython/dns/resolver.py @@ -61,6 +61,10 @@ class NoRootSOA(dns.exception.DNSException): This should never happen!""" pass +class NoMetaqueries(dns.exception.DNSException): + """Metaqueries are not allowed.""" + pass + class Answer(object): """DNS stub resolver answer @@ -571,8 +575,12 @@ class Resolver(object): qname = dns.name.from_text(qname, None) if isinstance(rdtype, (str, unicode)): rdtype = dns.rdatatype.from_text(rdtype) + if dns.rdatatype.is_metatype(rdtype): + raise NoMetaqueries if isinstance(rdclass, (str, unicode)): rdclass = dns.rdataclass.from_text(rdclass) + if dns.rdataclass.is_metaclass(rdclass): + raise NoMetaqueries qnames_to_try = [] if qname.is_absolute(): qnames_to_try.append(qname) diff --git a/lib/dnspython/dns/version.py b/lib/dnspython/dns/version.py index fe0e324217..46799a77d9 100644 --- a/lib/dnspython/dns/version.py +++ b/lib/dnspython/dns/version.py @@ -17,7 +17,7 @@ MAJOR = 1 MINOR = 9 -MICRO = 2 +MICRO = 3 RELEASELEVEL = 0x0f SERIAL = 0 diff --git a/lib/dnspython/setup.py b/lib/dnspython/setup.py index 59bd0ebc95..f84711f795 100755 --- a/lib/dnspython/setup.py +++ b/lib/dnspython/setup.py @@ -18,7 +18,7 @@ import sys from distutils.core import setup -version = '1.9.2' +version = '1.9.3' kwargs = { 'name' : 'dnspython', -- cgit