gpg-agent service sets wrong SSH_AUTH_SOCK value

Bug #1675925 reported by André Colomb on 2017-03-24
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnupg2 (Ubuntu)
High
Dimitri John Ledkov
Yakkety
Undecided
Unassigned

Bug Description

After upgrading from xenial to yakkety, I noticed that my SSH_AUTH_SOCK environment variable pointed to $GNUPGHOME/S.gpg-agent.ssh, which is no longer the correct location with the current gnupg 2.1 package.

After much investigation, it appears that the variable is set by upstart in the /usr/share/upstart/sessions/gpg-agent.conf script. Attached patch corrects this script to point to the new default location at $XDG_RUNTIME_DIR/gnupg/.

The logic is shamelessly stolen from gnupg-agent's systemd user service file, /usr/lib/systemd/user/gpg-agent.service, which is apparently not used.

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: gnupg-agent 2.1.15-1ubuntu6
ProcVersionSignature: Ubuntu 4.8.0-41.44-lowlatency 4.8.17
Uname: Linux 4.8.0-41-lowlatency x86_64
ApportVersion: 2.20.3-0ubuntu8.2
Architecture: amd64
CurrentDesktop: GNOME
Date: Fri Mar 24 21:26:51 2017
InstallationDate: Installed on 2012-10-22 (1613 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
SourcePackage: gnupg2
UpgradeStatus: Upgraded to yakkety on 2017-03-19 (5 days ago)
upstart.no-pinentry-gnome3.log:
 initctl: invalid option: --no-wait
 Try `initctl --help' for more information.

André Colomb (acolomb) wrote :
André Colomb (acolomb) wrote :

My first attempt to fix this involved trying to move gpg-agent invocation from upstart to systemd --user. I got that to work by creating:
~/.config/upstart/gpg-agent.override (manual)
~/.config/systemd/user/default.target.wants/gpg-agent.service -> /usr/lib/systemd/user/gpg-agent.service
~/.config/systemd/user/gpg-agent.service.d/override.conf ([Unit]
Before=graphical-session-pre.target)

That correctly started the gpg-agent service, but the environment variables were not visible within a terminal started from gnome-shell. Somehow upstart seems to be the only way for setting env vars, the systemd user service unit does not work as intended. Upstart needs to die. Fast ;-)

The attachment "Fix for SSH_AUTH_SOCK path" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in gnupg2 (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Dimitri John Ledkov (xnox)
milestone: none → ubuntu-17.04
André Colomb (acolomb) wrote :

Hello Dimitri and thank you for taking up this issue. Does the milestone ubuntu-17.04 mean that there will not be an SRU for this one-line patch?

rahmadani (rahmadani) on 2017-03-31
Changed in gnupg2 (Ubuntu Yakkety):
assignee: nobody → rahmadani (rahmadani)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnupg2 - 2.1.15-1ubuntu7

---------------
gnupg2 (2.1.15-1ubuntu7) zesty; urgency=medium

  * gpg-agent.conf: use XDG_RUNTIME_DIR for ssh-agent socket, in the
    upstart user session job too. LP: #1675925.

 -- Dimitri John Ledkov <email address hidden> Wed, 29 Mar 2017 16:15:15 +0100

Changed in gnupg2 (Ubuntu):
status: Confirmed → Fix Released
Jeremy Bicha (jbicha) on 2017-04-08
Changed in gnupg2 (Ubuntu Yakkety):
assignee: rahmadani (rahmadani) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers