[Python-modules-commits] r6064 - in packages/python-dns/trunk/debian (4 files)

kitterma-guest at users.alioth.debian.org kitterma-guest at users.alioth.debian.org
Wed Jul 30 19:27:16 UTC 2008


    Date: Wednesday, July 30, 2008 @ 19:27:14
  Author: kitterma-guest
Revision: 6064

Package new upstream release for Lenny and fix #492996

Added:
  packages/python-dns/trunk/debian/patches/ignore-ipv6-ns.patch
Modified:
  packages/python-dns/trunk/debian/changelog
  packages/python-dns/trunk/debian/copyright
Deleted:
  packages/python-dns/trunk/debian/patches/source-tid-random.patch

Modified: packages/python-dns/trunk/debian/changelog
===================================================================
--- packages/python-dns/trunk/debian/changelog	2008-07-27 20:04:56 UTC (rev 6063)
+++ packages/python-dns/trunk/debian/changelog	2008-07-30 19:27:14 UTC (rev 6064)
@@ -1,3 +1,16 @@
+python-dns (2.3.2-1) unstable; urgency=low
+
+  * New upstream release
+    - Upstream fix for source port and TID randomization
+    - Drop debian/patches/source-tid-random.patch (upstream incorporated
+      a fix for this)
+  * Add debian/patches/ignore-ipv6-ns.patch so python-dns ignores IPv6
+    name servers and works in a mixed environment (Closes: #492996)
+    - Thanks to Julian Mehnle for the patch    
+  * Added missing final newline in debian/copyright
+
+ -- Scott Kitterman <scott at kitterman.com>  Wed, 30 Jul 2008 12:25:06 -0400
+
 python-dns (2.3.1-6) unstable; urgency=high
 
   * Fix debian/patches/source-tid-random.patch so it doesn't lose socket

Modified: packages/python-dns/trunk/debian/copyright
===================================================================
--- packages/python-dns/trunk/debian/copyright	2008-07-27 20:04:56 UTC (rev 6063)
+++ packages/python-dns/trunk/debian/copyright	2008-07-30 19:27:14 UTC (rev 6064)
@@ -153,4 +153,5 @@
 
 8. By copying, installing or otherwise using Python, Licensee
 agrees to be bound by the terms and conditions of this License
-Agreement.
\ No newline at end of file
+Agreement.
+

Added: packages/python-dns/trunk/debian/patches/ignore-ipv6-ns.patch
===================================================================
--- packages/python-dns/trunk/debian/patches/ignore-ipv6-ns.patch	                        (rev 0)
+++ packages/python-dns/trunk/debian/patches/ignore-ipv6-ns.patch	2008-07-30 19:27:14 UTC (rev 6064)
@@ -0,0 +1,16 @@
+diff -Nur -x '*.orig' -x '*~' python-dns-2.3.2/DNS/Base.py python-dns-2.3.2.new/DNS/Base.py
+--- python-dns-2.3.2/DNS/Base.py	2008-07-27 21:27:00.000000000 -0400
++++ python-dns-2.3.2.new/DNS/Base.py	2008-07-30 12:21:44.000000000 -0400
+@@ -55,7 +55,11 @@
+         if fields[0]=='sortlist':
+             pass
+         if fields[0]=='nameserver':
+-            defaults['server'].append(fields[1])
++            if fields[1].count(':'):
++                """ Ignore IPv6 nameservers as we currently do not support querying them. """
++                pass
++            else:
++                defaults['server'].append(fields[1])
+ 
+ def DiscoverNameServers():
+     import sys

Deleted: packages/python-dns/trunk/debian/patches/source-tid-random.patch
===================================================================
--- packages/python-dns/trunk/debian/patches/source-tid-random.patch	2008-07-27 20:04:56 UTC (rev 6063)
+++ packages/python-dns/trunk/debian/patches/source-tid-random.patch	2008-07-30 19:27:14 UTC (rev 6064)
@@ -1,153 +0,0 @@
-diff -Nur -x '*.orig' -x '*~' python-dns-2.3.1/DNS/Base.py python-dns-2.3.1.new/DNS/Base.py
---- python-dns-2.3.1/DNS/Base.py	2007-05-22 16:28:31.000000000 -0400
-+++ python-dns-2.3.1.new/DNS/Base.py	2008-07-26 22:08:21.000000000 -0400
-@@ -12,6 +12,11 @@
- import socket, string, types, time
- import Type,Class,Opcode
- import asyncore
-+try:
-+  from random import SystemRandom
-+  random = SystemRandom()
-+except:
-+  import random
- 
- class DNSError(Exception): pass
- 
-@@ -58,6 +63,7 @@
-         self.defaults = {}
-         self.argparse(name,args)
-         self.defaults = self.args
-+        self.tid = 0
- 
-     def argparse(self,name,args):
-         if not name and self.defaults.has_key('name'):
-@@ -87,7 +93,7 @@
-             r,w,e = select.select([self.s],[],[],self.args['timeout'])
-             if not len(r):
-                 raise DNSError, 'Timeout'
--        self.reply = self.s.recv(1024)
-+        (self.reply, self.from_address) = self.s.recvfrom(65535)
-         self.time_finish=time.time()
-         self.args['server']=self.ns
-         return self.processReply()
-@@ -133,7 +139,21 @@
- #                u = Lib.Munpacker(reply)
- #                Lib.dumpM(u)
- 
-+    def getSource(self):
-+        # Get random source port to avoid DNS cache poisoning attack.
-+        try:
-+            source = random.randint(1024,65535)
-+            self.s.bind(('', source))
-+        except socket.error, msg: 
-+            # Error 98, 'Address already in use'
-+            if msg[0] == 98:
-+                self.getSource()
-+            else:
-+                raise
-+
-     def conn(self):
-+        # Source is source port we'll take a reply from.
-+        self.getSource()
-         self.s.connect((self.ns,self.port))
- 
-     def req(self,*name,**args):
-@@ -144,6 +164,7 @@
-         #    raise DNSError,'reinitialize request before reuse'
-         protocol = self.args['protocol']
-         self.port = self.args['port']
-+        self.tid = random.randint(0,65535)
-         opcode = self.args['opcode']
-         rd = self.args['rd']
-         server=self.args['server']
-@@ -164,7 +185,7 @@
-         #print 'QTYPE %d(%s)' % (qtype, Type.typestr(qtype))
-         m = Lib.Mpacker()
-         # jesus. keywords and default args would be good. TODO.
--        m.addHeader(0,
-+        m.addHeader(self.tid,
-               0, opcode, 0, 0, rd, 0, 0, 0,
-               1, 0, 0, 0)
-         m.addQuestion(qname, qtype, Class.IN)
-@@ -187,20 +208,31 @@
-         self.socketInit(socket.AF_INET, socket.SOCK_DGRAM)
-         for self.ns in server:
-             try:
--                # TODO. Handle timeouts &c correctly (RFC)
--                #self.s.connect((self.ns, self.port))
--                self.conn()
--                self.time_start=time.time()
--                if not self.async:
--                    self.s.send(self.request)
--                    self.response=self.processUDPReply()
--            #except socket.error:
--            except None:
--                continue
-+                try:
-+                    # TODO. Handle timeouts &c correctly (RFC)
-+                    #self.s.connect((self.ns, self.port))
-+                    self.conn()
-+                    self.s.setblocking(0)
-+                    self.time_start=time.time()
-+                    if not self.async:
-+                        self.s.send(self.request)
-+                        r=self.processUDPReply()
-+                        # Since we bind to the source port, we don't need to check that
-+                        # here, but do make sure it's actually a DNS request that the packet
-+                        # is in reply to.
-+                        while r.header['id'] != self.tid or self.from_address[1] != 53:
-+                          r=self.processUDPReply()
-+                        self.response = r
-+                        # FIXME: check waiting async queries
-+                #except socket.error:
-+                except None:
-+                    continue
-+            finally:
-+                self.s.close()
-             break
-         if not self.response:
-             if not self.async:
--                raise DNSError,'no working nameservers found'
-+                raise DNSError,('no working nameservers found')
- 
-     def sendTCPRequest(self, server):
-         " do the work of sending a TCP request "
-@@ -208,14 +240,21 @@
-         self.response=None
-         for self.ns in server:
-             try:
--                self.socketInit(socket.AF_INET, socket.SOCK_STREAM)
--                self.time_start=time.time()
--                self.conn()
--                self.s.send(Lib.pack16bit(len(self.request))+self.request)
--                self.s.shutdown(1)
--                self.response=self.processTCPReply()
--            except socket.error:
--                continue
-+                try:
-+                    # TODO. Handle timeouts &c correctly (RFC)
-+                    self.socketInit(socket.AF_INET, socket.SOCK_STREAM)
-+                    self.time_start=time.time()
-+                    self.conn()
-+                    self.s.setblocking(0)
-+                    self.s.sendall(Lib.pack16bit(len(self.request))+self.request)
-+                    self.s.shutdown(socket.SHUT_WR)
-+                    r=self.processTCPReply()
-+                    if r.header['id'] != self.tid: continue
-+                    self.response = r
-+                except socket.error:
-+                    continue
-+            finally:
-+                self.s.close()
-             break
-         if not self.response:
-             raise DNSError,'no working nameservers found'
-@@ -234,6 +273,8 @@
-         self.async=1
-     def conn(self):
-         import time
-+        # Source is source port we'll take a reply from.
-+        self.getSource()
-         self.connect((self.ns,self.port))
-         self.time_start=time.time()
-         if self.args.has_key('start') and self.args['start']:




More information about the Python-modules-commits mailing list