Traceback when verifying if connection is IPv6

Bug #1184367 reported by Scott Kitterman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
py3dns (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
Medium
Scott Kitterman
Quantal
Fix Released
High
Scott Kitterman
Raring
Fix Released
High
Scott Kitterman

Bug Description

Only an issue with python3-spf. Python-spf is fine due to differences between pydns and py3dns.

$ python3 /usr/lib/python3/dist-packages/spf.py 2001:7b8:206:1::5 <email address hidden> unbound.net
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/spf.py", line 1971, in <module>
    print(q.check(),q.mechanism)
  File "/usr/lib/python3/dist-packages/spf.py", line 543, in check
    rc = self.check1(spf, self.d, 0)
  File "/usr/lib/python3/dist-packages/spf.py", line 582, in check1
    return self.check0(spf, recursion)
  File "/usr/lib/python3/dist-packages/spf.py", line 876, in check0
    if self.cidrmatch(self.dns_mx(arg), cidrlength):
  File "/usr/lib/python3/dist-packages/spf.py", line 1289, in cidrmatch
    for ip in [bin(ip) for ip in ipaddrs]:
  File "/usr/lib/python3/dist-packages/spf.py", line 1289, in <listcomp>
    for ip in [bin(ip) for ip in ipaddrs]:
  File "/usr/lib/python3/dist-packages/spf.py", line 1733, in bin2long6
    h, l = struct.unpack("!QQ", str)
TypeError: 'str' does not support the buffer interface

[Impact]

 * When the spf module is used in python3, it will fail.
 * For 12.10/13.04 there is one application in the archive that will do this (postfix-policyd-spf-python). This will cause all mail to fail to be delivered until the policy server is respawned by postfix.

[Test Case]

 * Install python3-spf
 * Try the command shown above in the bug
 * See the traceback
 * Update to the -proposed package
 * Repeat the command
 * See no traceback and this instead:

$ python3 spf.py 2001:7b8:206:1::53 <email address hidden> unbound.net
('pass', 250, 'sender SPF authorized') mx

[Regression Potential]

 * Nil. The change is very easy to test and it will be obvious in verification if it works.
* There is a python3-dns bug in 12.04 that also needs to be fixed to make this work.

[Other Info]

Fixed in Debian and synced to saucy already.

Changed in pyspf (Ubuntu):
status: New → Fix Released
importance: Undecided → High
Changed in pyspf (Ubuntu Precise):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Scott Kitterman (kitterman)
Changed in pyspf (Ubuntu Quantal):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Scott Kitterman (kitterman)
Changed in pyspf (Ubuntu Raring):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Scott Kitterman (kitterman)
Revision history for this message
Scott Kitterman (kitterman) wrote :

Turns out the better way to fix this is in py3dns. Reverted pyspf and new py3dns uploaded to Debian and will sync soon

affects: pyspf (Ubuntu) → py3dns (Ubuntu)
Revision history for this message
Scott Kitterman (kitterman) wrote :

All uploaded for 12.04/12.10/13.04.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Fixed in 3.0.3-1 in saucy.

Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Scott, or anyone else affected,

Accepted py3dns into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/py3dns/3.0.1-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in py3dns (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in py3dns (Ubuntu Quantal):
status: In Progress → Fix Committed
Revision history for this message
Adam Conrad (adconrad) wrote :

Hello Scott, or anyone else affected,

Accepted py3dns into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/py3dns/3.0.2-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in py3dns (Ubuntu Raring):
status: In Progress → Fix Committed
Revision history for this message
Adam Conrad (adconrad) wrote :

Hello Scott, or anyone else affected,

Accepted py3dns into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/py3dns/3.0.2-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Scott Kitterman (kitterman) wrote :

Verified in 12.04:

Preparing to replace python3-dns 3.0.1-1ubuntu1 (using .../python3-dns_3.0.1-1ubuntu1.1_all.deb) ...
Unpacking replacement python3-dns ...
Setting up python3-dns (3.0.1-1ubuntu1.1) ...
$ python3 /usr/lib/python3/dist-packages/spf.py 2001:7b8:206:1::5 <email address hidden> unbound.net
('fail', 550, 'SPF fail - not authorized') -all

Verified for 12.10:

Preparing to replace python3-dns 3.0.2-1 (using .../python3-dns_3.0.2-1ubuntu0.1_all.deb) ...
Unpacking replacement python3-dns ...
Setting up python3-dns (3.0.2-1ubuntu0.1) ...
$ python3 /usr/lib/python3/dist-packages/spf.py 2001:7b8:206:1::5 <email address hidden> unbound.net
('fail', 550, 'SPF fail - not authorized') -all

Verified for 13.04:

Preparing to replace python3-dns 3.0.2-1 (using .../python3-dns_3.0.2-1ubuntu1_all.deb) ...
Unpacking replacement python3-dns ...
Setting up python3-dns (3.0.2-1ubuntu1) ...
$ python3 /usr/lib/python3/dist-packages/spf.py 2001:7b8:206:1::5 <email address hidden> unbound.net
('fail', 550, 'SPF fail - not authorized') -all

v-done.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package py3dns - 3.0.2-1ubuntu0.1

---------------
py3dns (3.0.2-1ubuntu0.1) quantal-proposed; urgency=low

  * Revert AAAA query result type change and return raw bytes instead of
    string (LP: #1184367)
 -- Scott Kitterman <email address hidden> Wed, 29 May 2013 21:56:47 -0400

Changed in py3dns (Ubuntu Quantal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package py3dns - 3.0.1-1ubuntu1.1

---------------
py3dns (3.0.1-1ubuntu1.1) precise-proposed; urgency=low

  * Revert AAAA query result type change and return raw bytes instead of
    string (LP: #1184367)
 -- Scott Kitterman <email address hidden> Wed, 29 May 2013 21:50:19 -0400

Changed in py3dns (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package py3dns - 3.0.2-1ubuntu1

---------------
py3dns (3.0.2-1ubuntu1) raring-proposed; urgency=low

  * Revert AAAA query result type change and return raw bytes instead of
    string (LP: #1184367)
  * Override dh_auto_clean and provide manual clean rule to fix FTBFS due to
    dh_auto_clean trying to run clean for python, not python3
 -- Scott Kitterman <email address hidden> Wed, 29 May 2013 21:56:47 -0400

Changed in py3dns (Ubuntu Raring):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.