Attached.  I'll upload shortly.

Scott K
diff -Nru tumgreyspf-1.36/debian/changelog tumgreyspf-1.36/debian/changelog
--- tumgreyspf-1.36/debian/changelog	2012-05-19 05:11:28.000000000 -0400
+++ tumgreyspf-1.36/debian/changelog	2013-11-10 23:55:24.000000000 -0500
@@ -1,3 +1,13 @@
+tumgreyspf (1.36-4.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Urgency medium for RC bug fix for Testing
+  * Add debian/patches/007-no-pyspf-internals.diff to restore local copies of
+    functions that were removed from python-spf so tumgreyspf will start
+    (Closes: #718308)
+
+ -- Scott Kitterman <sc...@kitterman.com>  Sun, 10 Nov 2013 23:53:19 -0500
+
 tumgreyspf (1.36-4) unstable; urgency=low
 
   * Switching to format 3.0 (quilt): all version 1.36 didn't have the patches
diff -Nru tumgreyspf-1.36/debian/copyright tumgreyspf-1.36/debian/copyright
--- tumgreyspf-1.36/debian/copyright	2012-05-19 05:11:28.000000000 -0400
+++ tumgreyspf-1.36/debian/copyright	2013-11-10 23:59:41.000000000 -0500
@@ -27,3 +27,23 @@
  .
  On Debian systems, the complete text of the GNU General Public License v2
  (GPL) can be found in /usr/share/common-licenses/GPL-2.
+
+Files: tumgreyspf (portions)
+Copyright: (c) 2003, Terence Way
+        Portions Copyright (c) 2004,2005,2006,2007,2008 Stuart Gathman <stu...@bmsi.com>
+        Portions Copyright (c) 2005,2006,2007,2008,2011,2012 Scott Kitterman <sc...@kitterman.com>
+License: PSF
+This module is free software, and you may redistribute it and/or modify
+it under the same terms as Python itself, so long as this copyright message
+and disclaimer are retained in their original form.
+.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+.
+THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
+AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
+SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
diff -Nru tumgreyspf-1.36/debian/patches/007-no-pyspf-internals.diff tumgreyspf-1.36/debian/patches/007-no-pyspf-internals.diff
--- tumgreyspf-1.36/debian/patches/007-no-pyspf-internals.diff	1969-12-31 19:00:00.000000000 -0500
+++ tumgreyspf-1.36/debian/patches/007-no-pyspf-internals.diff	2013-11-10 23:52:40.000000000 -0500
@@ -0,0 +1,195 @@
+Index: tumgreyspf-1.36/tumgreyspf
+===================================================================
+--- tumgreyspf-1.36.orig/tumgreyspf	2013-11-10 20:41:45.000000000 -0500
++++ tumgreyspf-1.36/tumgreyspf	2013-11-10 23:52:37.320166793 -0500
+@@ -6,6 +6,26 @@
+ #  Copyright (c) 2004-2007, Sean Reifschneider, tummy.com, ltd.
+ #  All Rights Reserved
+ #  <j...@tummy.com>
++#
++# For code copied from pyspf, the following applies:
++# Copyright (c) 2003, Terence Way
++# Portions Copyright (c) 2004,2005,2006,2007,2008 Stuart Gathman <stu...@bmsi.com>
++# Portions Copyright (c) 2005,2006,2007,2008,2011,2012 Scott Kitterman <sc...@kitterman.com>
++# This module is free software, and you may redistribute it and/or modify
++# it under the same terms as Python itself, so long as this copyright message
++# and disclaimer are retained in their original form.
++#
++# IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
++# SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
++# THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
++# DAMAGE.
++#
++# THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++# PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
++# AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
++# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
++
+ 
+ S_rcsid = '$Id: tumgreyspf,v 1.29 2007-10-08 00:39:37 jafo Exp $'
+ 
+@@ -19,19 +39,159 @@
+ tumgreyspfsupp.setExceptHook()
+ 
+ #############################################
++# Copied from pyspf 2.0.7
++import struct
++
++def addr2bin(str):
++    """Convert a string IPv4 address into an unsigned integer.
++
++    Examples::
++    >>> import sys
++    >>> if sys.version_info[0] == 2:
++    ...     print(long(addr2bin('127.0.0.1')))
++    ... else:
++    ...     print(addr2bin('127.0.0.1'))
++    2130706433
++
++    >>> addr2bin('127.0.0.1') == socket.INADDR_LOOPBACK
++    1
++
++    >>> print(addr2bin('255.255.255.254'))
++    4294967294
++
++    >>> print(addr2bin('192.168.0.1'))
++    3232235521
++
++    Unlike DNS.addr2bin, the n, n.n, and n.n.n forms for IP addresses
++    are handled as well::
++    >>> import sys
++    >>> if sys.version_info[0] == 2:
++    ...     print(long(addr2bin('10.65536')))
++    ... else:
++    ...     print(addr2bin('10.65536'))
++    167837696
++
++    >>> import sys
++    >>> if sys.version_info[0] == 2:
++    ...     print(long(addr2bin('10.93.512')))
++    ... else:
++    ...     print(addr2bin('10.93.512'))
++    173867520
++    """
++    return struct.unpack("!L", socket.inet_aton(str))[0]
++
++def bin2long6(str):
++    h, l = struct.unpack("!QQ", str)
++    return h << 64 | l
++
++if hasattr(socket,'has_ipv6') and socket.has_ipv6:
++    def inet_ntop(s):
++        return socket.inet_ntop(socket.AF_INET6,s)
++    def inet_pton(s):
++        return socket.inet_pton(socket.AF_INET6,s)
++else:
++    def inet_ntop(s):
++      """Convert ip6 address to standard hex notation.
++      Examples:
++      >>> inet_ntop(struct.pack("!HHHHHHHH",0,0,0,0,0,0xFFFF,0x0102,0x0304))
++      '::FFFF:1.2.3.4'
++      >>> inet_ntop(struct.pack("!HHHHHHHH",0x1234,0x5678,0,0,0,0,0x0102,0x0304))
++      '1234:5678::102:304'
++      >>> inet_ntop(struct.pack("!HHHHHHHH",0,0,0,0x1234,0x5678,0,0x0102,0x0304))
++      '::1234:5678:0:102:304'
++      >>> inet_ntop(struct.pack("!HHHHHHHH",0x1234,0x5678,0,0x0102,0x0304,0,0,0))
++      '1234:5678:0:102:304::'
++      >>> inet_ntop(struct.pack("!HHHHHHHH",0,0,0,0,0,0,0,0))
++      '::'
++      """
++      # convert to 8 words
++      a = struct.unpack("!HHHHHHHH",s)
++      n = (0,0,0,0,0,0,0,0)     # null ip6
++      if a == n: return '::'
++      # check for ip4 mapped
++      if a[:5] == (0,0,0,0,0) and a[5] in (0,0xFFFF):
++        ip4 = '.'.join([str(i) for i in struct.unpack("!HHHHHHBBBB",s)[6:]])
++        if a[5]:
++          return "::FFFF:" + ip4
++        return "::" + ip4
++      # find index of longest sequence of 0
++      for l in (7,6,5,4,3,2,1):
++        e = n[:l]
++        for i in range(9-l):
++          if a[i:i+l] == e:
++            if i == 0:
++              return ':'+':%x'*(8-l) % a[l:]
++            if i == 8 - l:
++              return '%x:'*(8-l) % a[:-l] + ':'
++            return '%x:'*i % a[:i] + ':%x'*(8-l-i) % a[i+l:]
++      return "%x:%x:%x:%x:%x:%x:%x:%x" % a
++
++    def inet_pton(p):
++      """Convert ip6 standard hex notation to ip6 address.
++      Examples:
++      >>> struct.unpack('!HHHHHHHH',inet_pton('::'))
++      (0, 0, 0, 0, 0, 0, 0, 0)
++      >>> struct.unpack('!HHHHHHHH',inet_pton('::1234'))
++      (0, 0, 0, 0, 0, 0, 0, 4660)
++      >>> struct.unpack('!HHHHHHHH',inet_pton('1234::'))
++      (4660, 0, 0, 0, 0, 0, 0, 0)
++      >>> struct.unpack('!HHHHHHHH',inet_pton('1234::5678'))
++      (4660, 0, 0, 0, 0, 0, 0, 22136)
++      >>> struct.unpack('!HHHHHHHH',inet_pton('::FFFF:1.2.3.4'))
++      (0, 0, 0, 0, 0, 65535, 258, 772)
++      >>> struct.unpack('!HHHHHHHH',inet_pton('1.2.3.4'))
++      (0, 0, 0, 0, 0, 65535, 258, 772)
++      >>> try: inet_pton('::1.2.3.4.5')
++      ... except ValueError,x: print x
++      ::1.2.3.4.5
++      """
++      if p == '::':
++        return '\0'*16
++      s = p
++      m = RE_IP4.search(s)
++      try:
++          if m:
++              pos = m.start()
++              ip4 = [int(i) for i in s[pos:].split('.')]
++              if not pos:
++                  return struct.pack('!QLBBBB',0,65535,*ip4)
++              s = s[:pos]+'%x%02x:%x%02x'%tuple(ip4)
++          a = s.split('::')
++          if len(a) == 2:
++            l,r = a
++            if not l:
++              r = r.split(':')
++              return struct.pack('!HHHHHHHH',
++                *[0]*(8-len(r)) + [int(s,16) for s in r])
++            if not r:
++              l = l.split(':')
++              return struct.pack('!HHHHHHHH',
++                *[int(s,16) for s in l] + [0]*(8-len(l)))
++            l = l.split(':')
++            r = r.split(':')
++            return struct.pack('!HHHHHHHH',
++                *[int(s,16) for s in l] + [0]*(8-len(l)-len(r))
++                + [int(s,16) for s in r])
++          if len(a) == 1:
++            return struct.pack('!HHHHHHHH',
++                *[int(s,16) for s in a[0].split(':')])
++      except ValueError: pass
++      raise ValueError(p)
++
++#############################################
+ def cidrmatch(connectip, ipaddrs, n):
+     """Match connect IP against a list of other IP addresses. From pyspf."""
+ 
+     try:
+         if connectip.count(':'):
+             MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFL
+-            connectip = spf.inet_pton(connectip)
++            connectip = inet_pton(connectip)
+             for arg in ipaddrs:
+-                ipaddrs[ipaddrs.index(arg)] = spf.inet_pton(arg)
+-            bin = spf.bin2long6
++                ipaddrs[ipaddrs.index(arg)] = inet_pton(arg)
++            bin = bin2long6
+         else:
+             MASK = 0xFFFFFFFFL
+-            bin = spf.addr2bin
++            bin = addr2bin
+         c = ~(MASK >> n) & MASK & bin(connectip)
+         for ip in [bin(ip) for ip in ipaddrs]:
+             if c == ~(MASK >> n) & MASK & ip: return True
diff -Nru tumgreyspf-1.36/debian/patches/series tumgreyspf-1.36/debian/patches/series
--- tumgreyspf-1.36/debian/patches/series	2012-05-19 05:11:28.000000000 -0400
+++ tumgreyspf-1.36/debian/patches/series	2013-11-10 23:34:50.000000000 -0500
@@ -4,3 +4,4 @@
 004-tumgreyspf-test.conf.diff
 005-tumgreyspf.conf.diff
 006-tumgreyspfsupp.py.diff
+007-no-pyspf-internals.diff

Attachment: signature.asc
Description: This is a digitally signed message part.



Reply via email to