gpass import code incorrectly calculates padding

Bug #991204 reported by Marc Deslauriers
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pasaffe
Fix Released
Undecided
Unassigned
pasaffe (Ubuntu)
Fix Released
Undecided
Marc Deslauriers
Precise
Fix Released
Undecided
Marc Deslauriers
Quantal
Fix Released
Undecided
Marc Deslauriers

Bug Description

When attempting to import a gpass database with padding, the following error is generated:

Traceback (most recent call last):
  File "/usr/bin/pasaffe-import-gpass", line 121, in <module>
    gpass = gpassfile.GPassFile(filename, password)
  File "/usr/lib/python2.7/dist-packages/pasaffe_lib/gpassfile.py", line 35, in __init__
    self.readfile(filename, password)
  File "/usr/lib/python2.7/dist-packages/pasaffe_lib/gpassfile.py", line 68, in readfile
    entry_type = self.get_string()
  File "/usr/lib/python2.7/dist-packages/pasaffe_lib/gpassfile.py", line 150, in get_string
    length = struct.unpack("<I", self.get_int())[0]
struct.error: unpack requires a string argument of length 4

Changed in pasaffe:
status: New → Fix Committed
Changed in pasaffe (Ubuntu):
status: New → Confirmed
assignee: nobody → Marc Deslauriers (mdeslaur)
Changed in pasaffe (Ubuntu Precise):
status: New → Confirmed
assignee: nobody → Marc Deslauriers (mdeslaur)
Changed in pasaffe:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pasaffe - 0.17-0ubuntu1

---------------
pasaffe (0.17-0ubuntu1) quantal; urgency=low

  * New upstream release
   - Add command-line option to specify default database
   - Don't save database specified on command line as default
   - Properly handle entries that have no URL specified (LP: #980608)
   - Fix logging in pasaffe-import scripts so we can debug failures
     (LP: #991143)
   - Correctly strip gpass database padding (LP: #991204)
   - Properly handle unicode characters with optparse (LP: #983210)
 -- Marc Deslauriers <email address hidden> Thu, 03 May 2012 20:37:15 -0400

Changed in pasaffe (Ubuntu Quantal):
status: Confirmed → Fix Released
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

SRU Request:

[Impact]
gpass database import script fails on a large number of gpass databases because of incorrect handling of the padding byte

[Development Fix]
Quantal has been fixed by updating to version 0.17 that contains the fix for this issue

[Stable Fix]
See attached patch for minimal fix for this issue.

[Test Case]
This may be slightly complicated
1- on an older release, install gpass
2- create a database
3- attempt to import into pasaffe
4- repeat until a database cannot be imported, and try again with the update

[Regression Potential]
This is an obvious fix, and if it's incorrect it would not prevent Pasaffe from working

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Marc, or anyone else affected,

Accepted pasaffe into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in pasaffe (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

I confirm the package in -proposed fixes the issue.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pasaffe - 0.16-0ubuntu1.1

---------------
pasaffe (0.16-0ubuntu1.1) precise-proposed; urgency=low

  * debian/patches/lp980608.patch: Don't print an error if trying to open a
    URL when none is set in an entry. (LP: #980608)
  * debian/patches/lp991143.patch: add option to turn on debugging when
    using the pasaffe-import-* scripts. (LP: #991143)
  * debian/patches/lp991204.patch: properly strip gpass database padding.
    (LP: #991204)
  * debian/patches/lp983210.patch: Properly handle unicode chars with
    optparse. (LP: #983210)
 -- Marc Deslauriers <email address hidden> Thu, 03 May 2012 20:13:13 -0400

Changed in pasaffe (Ubuntu Precise):
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.