Dropping a key into the list of keys fails

Bug #1383289 reported by Bruno Nova
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Medium
Michael Vogt
Trusty
Fix Released
Medium
Unassigned

Bug Description

[Impact]

Dragging a key into Software & Updates' authentication tab does nothing.

[Test Case]

1. Download a PGP key for a Debian repository (for example, the VideoLAN
   team's key: download.videolan.org/pub/debian/videolan-apt.asc)
2. Open "Software & Updates" from the Dash, then select the Authentication
   tab.
3. Open the PGP key file you downloaded with a text editor.
4. Select all of the text (Ctrl+A) and drag it into the list in the
   Authentication tab of Software & Updates.

   If the bug is fixed: admin authentication is requested. Authenticate,
   and then the key should be listed.
   If not: nothing happens, or an error is displayed.

[Regression Potential]

This feature isn't working, so I suppose there is not regression potential.

[Original Report]

When I drag a key text/file and drop it into the list of keys in the "Authentication" list, it fails silently (sometimes an apport bug report appears), throwing an exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 759, in on_auth_drag_data_received
    keydata = selection.data.strip()
AttributeError: 'SelectionData' object has no attribute 'data'

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: software-properties-gtk 0.92.37.1
ProcVersionSignature: Ubuntu 3.13.0-37.64-generic 3.13.11.7
Uname: Linux 3.13.0-37-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Oct 20 14:01:10 2014
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-10-13 (6 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
PackageArchitecture: all
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Bruno Nova (brunonova) wrote :
Bruno Nova (brunonova)
summary: - Dropping a key file into the list of keys fails
+ Dropping a key into the list of keys fails
description: updated
Revision history for this message
Bruno Nova (brunonova) wrote :

'SelectionData' has indeed no 'data' attribute. But it has a 'get_data()' method.
So, "selection.data.strip()" should be renamed to "selection.get_data().strip()" in softwareproperties/gtk/SoftwarePropertiesGtk.py (there are 2 occurrences).
Don't know if the bug exists in the KDE version.

But that doesn't fix everything. It will then throw these errors:
gpg: no writable keyring found: eof
gpg: error reading `/tmp/tmpcszfsj3q': general error
gpg: import from `/tmp/tmpcszfsj3q' failed: general error

Revision history for this message
Bruno Nova (brunonova) wrote :

Oh, before that there's another error:

Traceback (most recent call last):
  File "/home/bruno/src/software-properties/software-properties/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 760, in on_auth_drag_data_received
    if not self.add_key_from_data(keydata):
  File "/home/bruno/src/software-properties/software-properties/softwareproperties/SoftwareProperties.py", line 815, in add_key_from_data
    tmp.write(keydata.encode())
AttributeError: 'bytes' object has no attribute 'encode'

Just replace:
    tmp.write(keydata.encode())
with:
    tmp.write(keydata)
because keydata is already "bytes" at that point.

Revision history for this message
Bruno Nova (brunonova) wrote :

Ok, I think I got it. I'm going to link a branch that solves this soon.

Changed in software-properties (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Michael Vogt (mvo)
Bruno Nova (brunonova)
Changed in software-properties (Ubuntu):
status: Triaged → Fix Released
Michael Vogt (mvo)
Changed in software-properties (Ubuntu Trusty):
status: New → In Progress
importance: Undecided → Medium
Bruno Nova (brunonova)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Bruno, or anyone else affected,

Accepted software-properties into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/software-properties/0.92.37.4 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 software-properties (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Bruno Nova (brunonova) wrote :

I updated software-properties' installed binary packages to the version in -proposed, and now dragging a key into the list of keys work.
This fixes this bug!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Bruno Nova (brunonova) wrote :

However, this update doesn't fix the other bug (#1381050) unfortunately, so this shouldn't be uploaded to trusty-updates!

Revision history for this message
Mathew Hodson (mhodson) wrote :

Hello Bruno, or anyone else affected,

Accepted software-properties into trusty-proposed. The package is available at https://launchpad.net/ubuntu/+source/software-properties/0.92.37.5 and 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!

tags: added: verification-needed
removed: verification-done
Revision history for this message
Bruno Nova (brunonova) wrote :

I updated the software-properties packages to 0.92.37.5 from trusty-proposed.

The bug is fixed!
I opened my own PGP key (I already have the VLC's key) in gedit and dragged everything into the authentication list. I was asked for polkit authorization and then the key was successfully added.

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

This bug was fixed in the package software-properties - 0.92.37.5

---------------
software-properties (0.92.37.5) trusty-proposed; urgency=medium

  * cloudarchive: Enable support for the Liberty Ubuntu Cloud Archive on
    14.04 (LP: #1472586).
  * Revert SRU changes for "fix importing keys from path with special chars"
    due to verification-failed in trusty-proposed.

 -- Corey Bryant <email address hidden> Wed, 02 Sep 2015 12:31:11 -0400

Changed in software-properties (Ubuntu Trusty):
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.