summaryrefslogtreecommitdiffstats
path: root/debian/Xsession.d/90gpg-agent
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:59:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:59:16 +0000
commitabd376d1e24e6665ef3662eb23ad76adadf78f72 (patch)
treeec7213f75b7e8c9cdbb4d335ed9ca7c11aae6f5f /debian/Xsession.d/90gpg-agent
parentAdding upstream version 2.2.27. (diff)
downloadgnupg2-abd376d1e24e6665ef3662eb23ad76adadf78f72.tar.xz
gnupg2-abd376d1e24e6665ef3662eb23ad76adadf78f72.zip
Adding debian version 2.2.27-2+deb11u2.debian/2.2.27-2+deb11u2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/Xsession.d/90gpg-agent')
-rw-r--r--debian/Xsession.d/90gpg-agent22
1 files changed, 22 insertions, 0 deletions
diff --git a/debian/Xsession.d/90gpg-agent b/debian/Xsession.d/90gpg-agent
new file mode 100644
index 0000000..8b45b05
--- /dev/null
+++ b/debian/Xsession.d/90gpg-agent
@@ -0,0 +1,22 @@
+# On systems with systemd running, we expect the agent to be launched
+# via systemd's user mode (see
+# /usr/lib/systemd/user/gpg-agent.{socket,service} and
+# systemd.unit(5)). This allows systemd to clean up the agent
+# automatically at logout.
+
+# If systemd is absent from your system, or you do not permit it to
+# run in user mode, then you may need to manually launch gpg-agent
+# from your session initialization with something like "gpgconf
+# --launch gpg-agent"
+
+# Nonetheless, ssh and older versions of gpg require environment
+# variables to be set in order to find the agent, so we will set those
+# here.
+
+agent_sock=$(gpgconf --list-dirs agent-socket)
+export GPG_AGENT_INFO=${agent_sock}:0:1
+if [ -n "$(gpgconf --list-options gpg-agent | \
+ awk -F: '/^enable-ssh-support:/{ print $10 }')" ]; then
+ export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
+fi
+