[SCM] Samba Shared Repository - branch master updated
Jelmer Vernooij
jelmer at samba.org
Sat Aug 27 09:41:03 MDT 2011
The branch, master has been updated
via 8bd7135 dnspython: Update to latest upstream snapshot.
via bd01a8e subunit: Update to latest upstream snapshot.
via dd56d27 testtools: Update to latest upstream snapshot.
from ef3bb09 RAW_SFILEINFO_RENAME_INFORMATION_SMB2 sends 4 bytes of uninitialized data out on the network.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 8bd71350abe48fdcfc0125e48fa97abdf31e1270
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Sat Aug 27 16:07:52 2011 +0200
dnspython: Update to latest upstream snapshot.
Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
Autobuild-Date: Sat Aug 27 17:40:39 CEST 2011 on sn-devel-104
commit bd01a8e79faa3d657f01529c063cd0e09d711880
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Sat Aug 27 16:07:38 2011 +0200
subunit: Update to latest upstream snapshot.
commit dd56d27d74ad702803818237a2732d1e99b14da1
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Sat Aug 27 16:07:25 2011 +0200
testtools: Update to latest upstream snapshot.
-----------------------------------------------------------------------
Summary of changes:
lib/dnspython/ChangeLog | 71 ++
lib/dnspython/Makefile | 2 +-
lib/dnspython/README | 42 +-
lib/dnspython/dns/__init__.py | 3 +-
lib/dnspython/dns/dnssec.py | 6 +-
lib/dnspython/dns/e164.py | 2 +-
lib/dnspython/dns/edns.py | 2 +-
lib/dnspython/dns/entropy.py | 2 +-
lib/dnspython/dns/exception.py | 2 +-
lib/dnspython/dns/flags.py | 2 +-
lib/dnspython/dns/hash.py | 2 +-
lib/dnspython/dns/inet.py | 2 +-
lib/dnspython/dns/ipv4.py | 42 +-
lib/dnspython/dns/ipv6.py | 10 +-
lib/dnspython/dns/message.py | 5 +-
lib/dnspython/dns/name.py | 6 +-
lib/dnspython/dns/namedict.py | 2 +-
lib/dnspython/dns/node.py | 2 +-
lib/dnspython/dns/opcode.py | 2 +-
lib/dnspython/dns/query.py | 2 +-
lib/dnspython/dns/rcode.py | 2 +-
lib/dnspython/dns/rdata.py | 24 +-
lib/dnspython/dns/rdataclass.py | 4 +-
lib/dnspython/dns/rdataset.py | 2 +-
lib/dnspython/dns/rdatatype.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/AFSDB.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/CERT.py | 6 +-
lib/dnspython/dns/rdtypes/ANY/CNAME.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/DLV.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/DNAME.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/DNSKEY.py | 79 ++-
lib/dnspython/dns/rdtypes/ANY/DS.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/GPOS.py | 18 +-
lib/dnspython/dns/rdtypes/ANY/HINFO.py | 14 +-
lib/dnspython/dns/rdtypes/ANY/HIP.py | 6 +-
lib/dnspython/dns/rdtypes/ANY/ISDN.py | 6 +-
lib/dnspython/dns/rdtypes/ANY/KEY.py | 20 -
lib/dnspython/dns/rdtypes/ANY/LOC.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/MX.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/NS.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/NSEC.py | 21 +-
lib/dnspython/dns/rdtypes/ANY/NSEC3.py | 10 +-
lib/dnspython/dns/rdtypes/ANY/NSEC3PARAM.py | 4 +-
lib/dnspython/dns/rdtypes/ANY/NXT.py | 99 --
lib/dnspython/dns/rdtypes/ANY/PTR.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/RP.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/RRSIG.py | 143 +++-
lib/dnspython/dns/rdtypes/ANY/RT.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/SIG.py | 26 -
lib/dnspython/dns/rdtypes/ANY/SOA.py | 8 +-
lib/dnspython/dns/rdtypes/ANY/SPF.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/SSHFP.py | 12 +-
lib/dnspython/dns/rdtypes/ANY/TXT.py | 2 +-
lib/dnspython/dns/rdtypes/ANY/X25.py | 12 +-
lib/dnspython/dns/rdtypes/ANY/__init__.py | 5 +-
lib/dnspython/dns/rdtypes/IN/A.py | 2 +-
lib/dnspython/dns/rdtypes/IN/AAAA.py | 2 +-
lib/dnspython/dns/rdtypes/IN/APL.py | 4 +-
lib/dnspython/dns/rdtypes/IN/DHCID.py | 4 +-
lib/dnspython/dns/rdtypes/IN/IPSECKEY.py | 4 +-
lib/dnspython/dns/rdtypes/IN/KX.py | 2 +-
lib/dnspython/dns/rdtypes/IN/NAPTR.py | 12 +-
lib/dnspython/dns/rdtypes/IN/NSAP.py | 4 +-
lib/dnspython/dns/rdtypes/IN/NSAP_PTR.py | 2 +-
lib/dnspython/dns/rdtypes/IN/PX.py | 10 +-
lib/dnspython/dns/rdtypes/IN/SRV.py | 2 +-
lib/dnspython/dns/rdtypes/IN/WKS.py | 4 +-
lib/dnspython/dns/rdtypes/IN/__init__.py | 2 +-
lib/dnspython/dns/rdtypes/__init__.py | 4 +-
lib/dnspython/dns/rdtypes/dsbase.py | 4 +-
lib/dnspython/dns/rdtypes/keybase.py | 149 ---
lib/dnspython/dns/rdtypes/mxbase.py | 2 +-
lib/dnspython/dns/rdtypes/nsbase.py | 2 +-
lib/dnspython/dns/rdtypes/sigbase.py | 168 ---
lib/dnspython/dns/rdtypes/txtbase.py | 4 +-
lib/dnspython/dns/renderer.py | 5 +-
lib/dnspython/dns/resolver.py | 412 +++++++-
lib/dnspython/dns/reversename.py | 2 +-
lib/dnspython/dns/rrset.py | 2 +-
lib/dnspython/dns/set.py | 2 +-
lib/dnspython/dns/tokenizer.py | 2 +-
lib/dnspython/dns/tsig.py | 2 +-
lib/dnspython/dns/tsigkeyring.py | 2 +-
lib/dnspython/dns/ttl.py | 2 +-
lib/dnspython/dns/update.py | 2 +-
lib/dnspython/dns/version.py | 6 +-
lib/dnspython/dns/wiredata.py | 59 +
lib/dnspython/dns/zone.py | 2 +-
lib/dnspython/examples/xfr.py | 6 +-
lib/dnspython/setup.py | 17 +-
lib/dnspython/tests/Makefile | 2 +-
lib/dnspython/tests/bugs.py | 2 +-
lib/dnspython/tests/dnssec.py | 2 +-
lib/dnspython/tests/example | 41 +-
lib/dnspython/tests/example1.good | 9 +-
lib/dnspython/tests/example2.good | 9 +-
lib/dnspython/tests/flags.py | 2 +-
lib/dnspython/tests/message.py | 2 +-
lib/dnspython/tests/name.py | 6 +-
lib/dnspython/tests/namedict.py | 2 +-
lib/dnspython/tests/ntoaaton.py | 99 ++-
lib/dnspython/tests/rdtypeandclass.py | 2 +-
lib/dnspython/tests/resolver.py | 2 +-
lib/dnspython/tests/rrset.py | 2 +-
lib/dnspython/tests/set.py | 2 +-
lib/dnspython/tests/tokenizer.py | 2 +-
lib/dnspython/tests/update.py | 2 +-
lib/dnspython/tests/zone.py | 2 +-
lib/dnspython/util/copyrights | 197 ++--
lib/subunit/INSTALL | 2 +-
lib/subunit/NEWS | 61 +
lib/subunit/README | 46 +-
lib/subunit/c/tests/test_child.c | 3 +
lib/subunit/filters/subunit-filter | 37 +-
lib/subunit/filters/subunit-ls | 8 +-
lib/subunit/python/subunit/__init__.py | 322 ++++--
lib/subunit/python/subunit/chunked.py | 59 +-
lib/subunit/python/subunit/details.py | 30 +-
lib/subunit/python/subunit/iso8601.py | 22 +-
lib/subunit/python/subunit/run.py | 2 +-
lib/subunit/python/subunit/test_results.py | 225 +++-
lib/subunit/python/subunit/tests/TestUtil.py | 2 +-
lib/subunit/python/subunit/tests/sample-script.py | 3 +
lib/subunit/python/subunit/tests/test_chunked.py | 109 ++-
lib/subunit/python/subunit/tests/test_details.py | 45 +-
.../python/subunit/tests/test_subunit_filter.py | 218 +++--
.../python/subunit/tests/test_subunit_stats.py | 9 +-
.../python/subunit/tests/test_subunit_tags.py | 3 +-
.../python/subunit/tests/test_tap2subunit.py | 4 +-
.../python/subunit/tests/test_test_protocol.py | 555 ++++++----
.../python/subunit/tests/test_test_results.py | 125 ++-
lib/testtools/HACKING | 135 ---
lib/testtools/LICENSE | 20 +-
lib/testtools/MANIFEST.in | 4 +
lib/testtools/MANUAL | 349 ------
lib/testtools/Makefile | 27 +-
lib/testtools/NEWS | 214 ++++-
lib/testtools/README | 22 +-
lib/testtools/doc/Makefile | 89 ++
.../testtools/doc/_static/placeholder.txt | 0
.../testtools/doc/_templates/placeholder.txt | 0
lib/testtools/doc/conf.py | 194 +++
lib/testtools/doc/for-framework-folk.rst | 219 ++++
lib/testtools/doc/for-test-authors.rst | 1196 +++++++++++++++++++
lib/testtools/doc/hacking.rst | 154 +++
lib/testtools/doc/index.rst | 33 +
lib/testtools/doc/make.bat | 113 ++
lib/testtools/doc/overview.rst | 96 ++
lib/testtools/scripts/README | 3 +
lib/testtools/scripts/_lp_release.py | 230 ++++
lib/testtools/scripts/all-pythons | 90 ++
lib/testtools/scripts/update-rtfd | 11 +
lib/testtools/setup.cfg | 4 +
lib/testtools/setup.py | 17 +-
lib/testtools/testtools/__init__.py | 15 +-
lib/testtools/testtools/_compat2x.py | 17 +
lib/testtools/testtools/_compat3x.py | 17 +
lib/testtools/testtools/_spinner.py | 18 +-
lib/testtools/testtools/compat.py | 41 +-
lib/testtools/testtools/content.py | 138 +++-
lib/testtools/testtools/content_type.py | 10 +-
lib/testtools/testtools/deferredruntest.py | 18 +-
lib/testtools/testtools/distutilscmd.py | 62 +
lib/testtools/testtools/helpers.py | 41 +-
lib/testtools/testtools/matchers.py | 521 ++++++++-
lib/testtools/testtools/monkey.py | 4 +-
lib/testtools/testtools/run.py | 6 +-
lib/testtools/testtools/runtest.py | 17 +-
lib/testtools/testtools/testcase.py | 264 +++--
lib/testtools/testtools/testresult/__init__.py | 2 +-
lib/testtools/testtools/testresult/doubles.py | 2 +-
lib/testtools/testtools/testresult/real.py | 76 +-
lib/testtools/testtools/tests/__init__.py | 13 +-
lib/testtools/testtools/tests/helpers.py | 53 +-
lib/testtools/testtools/tests/test_compat.py | 20 +-
lib/testtools/testtools/tests/test_content.py | 167 +++-
lib/testtools/testtools/tests/test_content_type.py | 12 +-
.../testtools/tests/test_deferredruntest.py | 19 +-
lib/testtools/testtools/tests/test_distutilscmd.py | 98 ++
.../testtools/tests/test_fixturesupport.py | 48 +-
lib/testtools/testtools/tests/test_helpers.py | 136 +++-
lib/testtools/testtools/tests/test_matchers.py | 427 +++++++-
lib/testtools/testtools/tests/test_run.py | 22 +-
lib/testtools/testtools/tests/test_runtest.py | 7 +-
lib/testtools/testtools/tests/test_spinner.py | 2 +-
lib/testtools/testtools/tests/test_testcase.py | 1227 ++++++++++++++++++++
lib/testtools/testtools/tests/test_testresult.py | 307 ++++--
lib/testtools/testtools/tests/test_testsuite.py | 32 +-
lib/testtools/testtools/tests/test_testtools.py | 1135 ------------------
lib/testtools/testtools/tests/test_with_with.py | 73 ++
lib/testtools/testtools/testsuite.py | 24 +-
191 files changed, 8823 insertions(+), 3433 deletions(-)
delete mode 100644 lib/dnspython/dns/rdtypes/ANY/KEY.py
delete mode 100644 lib/dnspython/dns/rdtypes/ANY/NXT.py
delete mode 100644 lib/dnspython/dns/rdtypes/ANY/SIG.py
delete mode 100644 lib/dnspython/dns/rdtypes/keybase.py
delete mode 100644 lib/dnspython/dns/rdtypes/sigbase.py
create mode 100644 lib/dnspython/dns/wiredata.py
delete mode 100644 lib/testtools/HACKING
delete mode 100644 lib/testtools/MANUAL
create mode 100644 lib/testtools/doc/Makefile
copy Read-Manifest-Now => lib/testtools/doc/_static/placeholder.txt (100%)
copy Read-Manifest-Now => lib/testtools/doc/_templates/placeholder.txt (100%)
create mode 100644 lib/testtools/doc/conf.py
create mode 100644 lib/testtools/doc/for-framework-folk.rst
create mode 100644 lib/testtools/doc/for-test-authors.rst
create mode 100644 lib/testtools/doc/hacking.rst
create mode 100644 lib/testtools/doc/index.rst
create mode 100644 lib/testtools/doc/make.bat
create mode 100644 lib/testtools/doc/overview.rst
create mode 100644 lib/testtools/scripts/README
create mode 100644 lib/testtools/scripts/_lp_release.py
create mode 100755 lib/testtools/scripts/all-pythons
create mode 100755 lib/testtools/scripts/update-rtfd
create mode 100644 lib/testtools/setup.cfg
create mode 100644 lib/testtools/testtools/_compat2x.py
create mode 100644 lib/testtools/testtools/_compat3x.py
create mode 100644 lib/testtools/testtools/distutilscmd.py
create mode 100644 lib/testtools/testtools/tests/test_distutilscmd.py
create mode 100644 lib/testtools/testtools/tests/test_testcase.py
delete mode 100644 lib/testtools/testtools/tests/test_testtools.py
create mode 100644 lib/testtools/testtools/tests/test_with_with.py
Changeset truncated at 500 lines:
diff --git a/lib/dnspython/ChangeLog b/lib/dnspython/ChangeLog
index 0fff77f..71b7961 100644
--- a/lib/dnspython/ChangeLog
+++ b/lib/dnspython/ChangeLog
@@ -1,3 +1,74 @@
+2011-08-22 Robert Halley <halley at dnspython.org>
+
+ * dns/resolver.py: Added LRUCache, which allows a maximum number
+ of nodes to be cached, and removes the least-recently used node
+ when adding a new node to a full cache.
+
+2011-07-13 Bob Halley <halley at dnspython.org>
+
+ * dns/resolver.py: dns.resolver.override_system_resolver()
+ overrides the socket module's versions of getaddrinfo(),
+ getnameinfo(), getfqdn(), gethostbyname(), gethostbyname_ex() and
+ gethostbyaddr() with an implementation which uses a dnspython stub
+ resolver instead of the system's stub resolver. This can be
+ useful in testing situations where you want to control the
+ resolution behavior of python code without having to change the
+ system's resolver settings (e.g. /etc/resolv.conf).
+ dns.resolver.restore_system_resolver() undoes the change.
+
+2011-07-08 Bob Halley <halley at dnspython.org>
+
+ * dns/ipv4.py: dnspython now provides its own, stricter, versions
+ of IPv4 inet_ntoa() and inet_aton() instead of using the OS's
+ versions.
+
+ * dns/ipv6.py: inet_aton() now bounds checks embedded IPv4 addresses
+ more strictly. Also, now only dns.exception.SyntaxError can be
+ raised on bad input.
+
+2011-04-05 Bob Halley <halley at dnspython.org>
+
+ * Old DNSSEC types (KEY, NXT, and SIG) have been removed.
+
+ * Bounds checking of slices in rdata wire processing is now more
+ strict, and bounds errors (e.g. we got less data than was
+ expected) now raise dns.exception.FormError rather than
+ IndexError.
+
+2011-03-28 Bob Halley <halley at dnspython.org>
+
+ * (Version 1.9.4 released)
+
+2011-03-24 Bob Halley <halley at dnspython.org>
+
+ * dns/rdata.py (Rdata._wire_cmp): We need to specify no
+ compression and an origin to _wire_cmp() in case names in the
+ rdata are relative names.
+
+ * dns/rdtypes/ANY/SIG.py (SIG._cmp): Add missing 'import struct'.
+ Thanks to Arfrever Frehtes Taifersar Arahesis for reporting the
+ problem.
+
+2011-03-24 Bob Halley <halley at dnspython.org>
+
+ * (Version 1.9.3 released)
+
+2011-03-22 Bob Halley <halley at dnspython.org>
+
+ * dns/resolver.py: a boolean parameter, 'raise_on_no_answer', has
+ been added to the query() methods. In no-error, no-data
+ situations, this parameter determines whether NoAnswer should be
+ raised or not. If True, NoAnswer is raised. If False, then an
+ Answer() object with a None rrset will be returned.
+
+ * dns/resolver.py: Answer() objects now have a canonical_name field.
+
+2011-01-11 Bob Halley <halley at dnspython.org>
+
+ * Dnspython was erroneously doing case-insensitive comparisons
+ of the names in NSEC and RRSIG RRs. Thanks to Casey Deccio for
+ reporting this bug.
+
2010-12-17 Bob Halley <halley at dnspython.org>
* dns/message.py (_WireReader._get_section): use "is" and not "=="
diff --git a/lib/dnspython/Makefile b/lib/dnspython/Makefile
index 3dbfe95..1f62c96 100644
--- a/lib/dnspython/Makefile
+++ b/lib/dnspython/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009, 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/README b/lib/dnspython/README
index d53dac6..367e7a2 100644
--- a/lib/dnspython/README
+++ b/lib/dnspython/README
@@ -22,7 +22,47 @@ development by continuing to employ the author :).
ABOUT THIS RELEASE
-This is dnspython 1.9.2
+This is dnspython 1.10.0
+
+New since 1.9.4:
+
+ XXX TBS.
+
+Bugs fixed since 1.9.4:
+
+ XXX TBS.
+
+New since 1.9.3:
+
+ Nothing.
+
+Bugs fixed since 1.9.3:
+
+ The rdata _wire_cmp() routine now handles relative names.
+
+ The SIG RR implementation was missing 'import struct'.
+
+New since 1.9.2:
+
+ A boolean parameter, 'raise_on_no_answer', has been added to
+ the query() methods. In no-error, no-data situations, this
+ parameter determines whether NoAnswer should be raised or not.
+ If True, NoAnswer is raised. If False, then an Answer()
+ object with a None rrset will be returned.
+
+ Resolver Answer() objects now have a canonical_name field.
+
+ Rdata now have a __hash__ method.
+
+Bugs fixed since 1.9.2:
+
+ Dnspython was erroneously doing case-insensitive comparisons
+ of the names in NSEC and RRSIG RRs.
+
+ We now use "is" and not "==" when testing what section an RR
+ is in.
+
+ The resolver now disallows metaqueries.
New since 1.9.1:
diff --git a/lib/dnspython/dns/__init__.py b/lib/dnspython/dns/__init__.py
index 56e1e8a..c848e48 100644
--- a/lib/dnspython/dns/__init__.py
+++ b/lib/dnspython/dns/__init__.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009, 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -49,5 +49,6 @@ __all__ = [
'rdtypes',
'update',
'version',
+ 'wiredata',
'zone',
]
diff --git a/lib/dnspython/dns/dnssec.py b/lib/dnspython/dns/dnssec.py
index a595fd4..dd6a27a 100644
--- a/lib/dnspython/dns/dnssec.py
+++ b/lib/dnspython/dns/dnssec.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009, 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -99,7 +99,7 @@ def key_id(key, origin=None):
return (ord(rdata[-3]) << 8) + ord(rdata[-2])
else:
total = 0
- for i in range(len(rdata) / 2):
+ for i in range(len(rdata) // 2):
total += (ord(rdata[2 * i]) << 8) + ord(rdata[2 * i + 1])
if len(rdata) % 2 != 0:
total += ord(rdata[len(rdata) - 1]) << 8
@@ -299,7 +299,7 @@ def _validate_rrsig(rrset, rrsig, keys, origin=None, now=None):
if _is_rsa(rrsig.algorithm):
# PKCS1 algorithm identifier goop
digest = _make_algorithm_id(rrsig.algorithm) + digest
- padlen = keylen / 8 - len(digest) - 3
+ padlen = keylen // 8 - len(digest) - 3
digest = chr(0) + chr(1) + chr(0xFF) * padlen + chr(0) + digest
elif _is_dsa(rrsig.algorithm):
pass
diff --git a/lib/dnspython/dns/e164.py b/lib/dnspython/dns/e164.py
index d8f71ec..d6dcd1b 100644
--- a/lib/dnspython/dns/e164.py
+++ b/lib/dnspython/dns/e164.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007, 2009 Nominum, Inc.
+# Copyright (C) 2006, 2007, 2009, 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/edns.py b/lib/dnspython/dns/edns.py
index 1731ced..f8b6009 100644
--- a/lib/dnspython/dns/edns.py
+++ b/lib/dnspython/dns/edns.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Nominum, Inc.
+# Copyright (C) 2009, 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/entropy.py b/lib/dnspython/dns/entropy.py
index fd9d4f8..d380cf8 100644
--- a/lib/dnspython/dns/entropy.py
+++ b/lib/dnspython/dns/entropy.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Nominum, Inc.
+# Copyright (C) 2009, 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/exception.py b/lib/dnspython/dns/exception.py
index c6d6570..db6ef6e 100644
--- a/lib/dnspython/dns/exception.py
+++ b/lib/dnspython/dns/exception.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/flags.py b/lib/dnspython/dns/flags.py
index 17afdbc..35a8305 100644
--- a/lib/dnspython/dns/flags.py
+++ b/lib/dnspython/dns/flags.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/hash.py b/lib/dnspython/dns/hash.py
index 7bd5ae5..0c70803 100644
--- a/lib/dnspython/dns/hash.py
+++ b/lib/dnspython/dns/hash.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Nominum, Inc.
+# Copyright (C) 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/inet.py b/lib/dnspython/dns/inet.py
index 8a8f3e1..3b7e88f 100644
--- a/lib/dnspython/dns/inet.py
+++ b/lib/dnspython/dns/inet.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/ipv4.py b/lib/dnspython/dns/ipv4.py
index 1569da5..e117966 100644
--- a/lib/dnspython/dns/ipv4.py
+++ b/lib/dnspython/dns/ipv4.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -15,22 +15,28 @@
"""IPv4 helper functions."""
-import socket
-import sys
+import struct
-if sys.hexversion < 0x02030000 or sys.platform == 'win32':
- #
- # Some versions of Python 2.2 have an inet_aton which rejects
- # the valid IP address '255.255.255.255'. It appears this
- # problem is still present on the Win32 platform even in 2.3.
- # We'll work around the problem.
- #
- def inet_aton(text):
- if text == '255.255.255.255':
- return '\xff' * 4
- else:
- return socket.inet_aton(text)
-else:
- inet_aton = socket.inet_aton
+import dns.exception
-inet_ntoa = socket.inet_ntoa
+def inet_ntoa(address):
+ if len(address) != 4:
+ raise dns.exception.SyntaxError
+ return '%u.%u.%u.%u' % (ord(address[0]), ord(address[1]),
+ ord(address[2]), ord(address[3]))
+
+def inet_aton(text):
+ parts = text.split('.')
+ if len(parts) != 4:
+ raise dns.exception.SyntaxError
+ for part in parts:
+ if not part.isdigit():
+ raise dns.exception.SyntaxError
+ if len(part) > 1 and part[0] == '0':
+ # No leading zeros
+ raise dns.exception.SyntaxError
+ try:
+ bytes = [int(part) for part in parts]
+ return struct.pack('BBBB', *bytes)
+ except:
+ raise dns.exception.SyntaxError
diff --git a/lib/dnspython/dns/ipv6.py b/lib/dnspython/dns/ipv6.py
index 33c6713..69db34a 100644
--- a/lib/dnspython/dns/ipv6.py
+++ b/lib/dnspython/dns/ipv6.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -89,7 +89,7 @@ def inet_ntoa(address):
hex = ':'.join(chunks)
return hex
-_v4_ending = re.compile(r'(.*):(\d+)\.(\d+)\.(\d+)\.(\d+)$')
+_v4_ending = re.compile(r'(.*):(\d+\.\d+\.\d+\.\d+)$')
_colon_colon_start = re.compile(r'::.*')
_colon_colon_end = re.compile(r'.*::$')
@@ -113,9 +113,9 @@ def inet_aton(text):
#
m = _v4_ending.match(text)
if not m is None:
- text = "%s:%04x:%04x" % (m.group(1),
- int(m.group(2)) * 256 + int(m.group(3)),
- int(m.group(4)) * 256 + int(m.group(5)))
+ b = dns.ipv4.inet_aton(m.group(2))
+ text = "%s:%02x%02x:%02x%02x" % (m.group(1), ord(b[0]), ord(b[1]),
+ ord(b[2]), ord(b[3]))
#
# Try to turn '::<whatever>' into ':<whatever>'; if no match try to
# turn '<whatever>::' into '<whatever>:'
diff --git a/lib/dnspython/dns/message.py b/lib/dnspython/dns/message.py
index a124a3e..cf29133 100644
--- a/lib/dnspython/dns/message.py
+++ b/lib/dnspython/dns/message.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -34,6 +34,7 @@ import dns.rdatatype
import dns.rrset
import dns.renderer
import dns.tsig
+import dns.wiredata
class ShortHeader(dns.exception.FormError):
"""Raised if the DNS packet passed to from_wire() is too short."""
@@ -577,7 +578,7 @@ class _WireReader(object):
def __init__(self, wire, message, question_only=False,
one_rr_per_rrset=False):
- self.wire = wire
+ self.wire = dns.wiredata.maybe_wrap(wire)
self.message = message
self.current = 0
self.updating = False
diff --git a/lib/dnspython/dns/name.py b/lib/dnspython/dns/name.py
index f239c9b..ed3ffee 100644
--- a/lib/dnspython/dns/name.py
+++ b/lib/dnspython/dns/name.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -29,6 +29,7 @@ if sys.hexversion >= 0x02030000:
import encodings.idna
import dns.exception
+import dns.wiredata
NAMERELN_NONE = 0
NAMERELN_SUPERDOMAIN = 1
@@ -670,6 +671,7 @@ def from_wire(message, current):
if not isinstance(message, str):
raise ValueError("input to from_wire() must be a byte string")
+ message = dns.wiredata.maybe_wrap(message)
labels = []
biggest_pointer = current
hops = 0
@@ -678,7 +680,7 @@ def from_wire(message, current):
cused = 1
while count != 0:
if count < 64:
- labels.append(message[current : current + count])
+ labels.append(message[current : current + count].unwrap())
current += count
if hops == 0:
cused += count
diff --git a/lib/dnspython/dns/namedict.py b/lib/dnspython/dns/namedict.py
index 54afb77..9f5a0ef 100644
--- a/lib/dnspython/dns/namedict.py
+++ b/lib/dnspython/dns/namedict.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/node.py b/lib/dnspython/dns/node.py
index 785a245..7625c66 100644
--- a/lib/dnspython/dns/node.py
+++ b/lib/dnspython/dns/node.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/opcode.py b/lib/dnspython/dns/opcode.py
index 705bd09..3258c34 100644
--- a/lib/dnspython/dns/opcode.py
+++ b/lib/dnspython/dns/opcode.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/query.py b/lib/dnspython/dns/query.py
index 9dc88a6..addee4e 100644
--- a/lib/dnspython/dns/query.py
+++ b/lib/dnspython/dns/query.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/rcode.py b/lib/dnspython/dns/rcode.py
index c055f2e..7807782 100644
--- a/lib/dnspython/dns/rcode.py
+++ b/lib/dnspython/dns/rcode.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
diff --git a/lib/dnspython/dns/rdata.py b/lib/dnspython/dns/rdata.py
index 399677e..350bf79 100644
--- a/lib/dnspython/dns/rdata.py
+++ b/lib/dnspython/dns/rdata.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -32,6 +32,7 @@ import dns.name
import dns.rdataclass
import dns.rdatatype
import dns.tokenizer
+import dns.wiredata
_hex_chunksize = 32
@@ -256,6 +257,19 @@ class Rdata(object):
def __hash__(self):
return hash(self.to_digestable(dns.name.root))
+ def _wire_cmp(self, other):
+ # A number of types compare rdata in wire form, so we provide
+ # the method here instead of duplicating it.
+ #
+ # We specifiy an arbitrary origin of '.' when doing the
+ # comparison, since the rdata may have relative names and we
+ # can't convert a relative name to wire without an origin.
+ b1 = cStringIO.StringIO()
+ self.to_wire(b1, None, dns.name.root)
+ b2 = cStringIO.StringIO()
+ other.to_wire(b2, None, dns.name.root)
+ return cmp(b1.getvalue(), b2.getvalue())
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
"""Build an rdata object from text format.
@@ -399,12 +413,15 @@ def from_text(rdclass, rdtype, tok, origin = None, relativize = True):
Once a class is chosen, its from_text() class method is called
with the parameters to this function.
+ If I{tok} is a string, then a tokenizer is created and the string
--
Samba Shared Repository
More information about the samba-cvs
mailing list