Merge lp:~kramsmada/ubuntu/vivid/gnupg2/1407513-gpg-agent-set-ssh-env-vars into lp:ubuntu/vivid/gnupg2

Proposed by Mark Adams
Status: Needs review
Proposed branch: lp:~kramsmada/ubuntu/vivid/gnupg2/1407513-gpg-agent-set-ssh-env-vars
Merge into: lp:ubuntu/vivid/gnupg2
Diff against target: 44 lines (+22/-0)
2 files modified
debian/changelog (+8/-0)
debian/gpg-agent.user-session.upstart (+14/-0)
To merge this branch: bzr merge lp:~kramsmada/ubuntu/vivid/gnupg2/1407513-gpg-agent-set-ssh-env-vars
Reviewer Review Type Date Requested Status
Marc Deslauriers Approve
Review via email: mp+245538@code.launchpad.net

Description of the change

This fixes a bug I reported (LP: #1407513) which describes an issue where the upstart gpg-agent script only sets the GPG_AGENT_INFO environment variable when, in fact, it should also set SSH_AGENT_PID and SSH_AUTH_SOCK if "enable-ssh-support" is set in the GPG agent configuration.

Essentially, this patch modifies the existing upstart script so that it checks to see if the "enable-ssh-support" config flag is set, and if so, it sets and unsets the associated SSH environment variables appropriately.

This fix mainly applies to users who store their SSH keys on a GPG smartcard and would like to easily make them available to SSH-based applications.

To post a comment you must log in.
29. By Mark Adams

Updated debian/gpg-agent.user-session.upstart so that global environment
variables SSH_AUTH_SOCK and SSH_AGENT_PID are set if gpg-agent is running
with SSH support.; LP: #1407513

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

I think the merge request looks good. Once the dev release opens, it can be uploaded.

review: Approve
Revision history for this message
Mark Adams (kramsmada) wrote :

> I think the merge request looks good. Once the dev release opens, it can be
> uploaded.

Do you have any idea when that will be? (I'm new so I don't know how the dev releases usually work)

Unmerged revisions

29. By Mark Adams

Updated debian/gpg-agent.user-session.upstart so that global environment
variables SSH_AUTH_SOCK and SSH_AGENT_PID are set if gpg-agent is running
with SSH support.; LP: #1407513

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-10-30 15:32:48 +0000
3+++ debian/changelog 2015-01-05 00:16:42 +0000
4@@ -1,3 +1,11 @@
5+gnupg2 (2.0.26-3ubuntu2) UNRELEASED; urgency=medium
6+
7+ * Updated debian/gpg-agent.user-session.upstart so that global environment
8+ variables SSH_AUTH_SOCK and SSH_AGENT_PID are set if gpg-agent is running
9+ with SSH support.; LP: #1407513
10+
11+ -- Mark Adams <mark@markadams.me> Sun, 04 Jan 2015 17:57:24 -0600
12+
13 gnupg2 (2.0.26-3ubuntu1) vivid; urgency=medium
14
15 * Merge from Debian, remaining changes:
16
17=== modified file 'debian/gpg-agent.user-session.upstart'
18--- debian/gpg-agent.user-session.upstart 2014-04-28 16:42:05 +0000
19+++ debian/gpg-agent.user-session.upstart 2015-01-05 00:16:42 +0000
20@@ -13,10 +13,24 @@
21
22 eval "$(gpg-agent --daemon --sh)" >/dev/null
23 initctl set-env --global GPG_AGENT_INFO=$GPG_AGENT_INFO
24+
25+ grep -qs "^enable-ssh-support$" "$GNUPGHOME/gpg-agent.conf"
26+
27+ if [ $? -eq 0 ]; then
28+ initctl set-env --global SSH_AUTH_SOCK=$SSH_AUTH_SOCK
29+ initctl set-env --global SSH_AGENT_PID=$SSH_AGENT_PID
30+ fi
31 end script
32
33 post-stop script
34 GPG_AGENT_PID=$(echo $GPG_AGENT_INFO | cut -d : -f2)
35 kill $GPG_AGENT_PID 2>/dev/null || true
36 initctl unset-env --global GPG_AGENT_INFO
37+
38+ grep -qs "^enable-ssh-support$" "$GNUPGHOME/gpg-agent.conf"
39+
40+ if [ $? -eq 0 ]; then
41+ initctl unset-env --global SSH_AUTH_SOCK
42+ initctl unset-env --global SSH_AGENT_PID
43+ fi
44 end script

Subscribers

People subscribed via source and target branches

to all changes: