[Pkg-gnupg-commit] [gnupg2] 01/16: simplified xsession startup
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Apr 18 23:22:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit 712901f9fba12e44c8fa2c8a3fa95fff499b5eaf
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Wed Feb 17 18:58:20 2016 -0500
simplified xsession startup
---
debian/gnupg-agent.xsession | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/debian/gnupg-agent.xsession b/debian/gnupg-agent.xsession
index 8886f95..08392c3 100644
--- a/debian/gnupg-agent.xsession
+++ b/debian/gnupg-agent.xsession
@@ -1,19 +1,13 @@
: ${GNUPGHOME=$HOME/.gnupg}
-GPGAGENT=/usr/bin/gpg-agent
-
-if grep -qs '^[[:space:]]*use-agent' "$GNUPGHOME/gpg.conf" "$GNUPGHOME/options" &&
- test -x $GPGAGENT; then
-
- # Invoking gpg-agent with no arguments exits successfully if the agent
- # is already running on the standard socket
- if ! $GPGAGENT 2>/dev/null; then
- "$GPGAGENT" --daemon
- fi
- GPG_AGENT_INFO="${GNUPGHOME}/S.gpg-agent:0:1"
- export GPG_AGENT_INFO
- if grep -qs '^[[:space:]]*enable-ssh-support' "${GNUPGHOME}/gpg-agent.conf"; then
- SSH_AUTH_SOCK="${GNUPGHOME}/S.gpg-agent.ssh"
- export SSH_AUTH_SOCK
- fi
+# always launch the agent, and expose it via the environment to those
+# tools that need it:
+gpgconf --launch gpg-agent
+export GPG_AGENT_INFO=$GNUPGHOME/S.gpg-agent:0:1
+if [ -n "$(gpgconf --list-options gpg-agent | \
+ awk -F: '/^enable-ssh-support:/{ print $10 }')" ]; then
+ export SSH_AUTH_SOCK=$GNUPGHOME/S.gpg-agent.ssh
fi
+# the downside to this approach is that the agent gets launched before
+# dbus session is initialized, so it doesn't know the native
+# parameters for launching pinentry (if it relies on the session dbus).
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list