Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/18'
Browse files Browse the repository at this point in the history
* origin/pr/18:
  Prevent agent hang on alternative gpg homedir

Pull request description:

Fix: QubesOS/qubes-issues#9534
  • Loading branch information
marmarek committed Jan 3, 2025
2 parents 692fb5a + a97b280 commit 49c772f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions gpg-agent-placeholder
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/bash
set -euo pipefail

set -eo pipefail

# prevent starting real gpg-agent locally if it's redirected via split-gpg2
# Prevent starting real gpg-agent locally if it's redirected via split-gpg2,
# which only uses the default GnuPG home directory.
if [ -e /run/qubes-service/split-gpg2-client ]; then
exit 0
case "$@" in
*"--homedir $HOME/.gnupg "*)
exit 0
;;
esac
fi
# otherwise, launch gpg-agent
gpgagent=$(gpgconf --list-components | grep ^gpg-agent: | cut -d ':' -f 3)

# Otherwise, launch gpg-agent.
gpgagent="$(gpgconf --list-components | awk -F: '/^gpg-agent:/{print $3}')"
exec "$gpgagent" "$@"

0 comments on commit 49c772f

Please sign in to comment.