Upgrade the way GPG agent is handled.

GnuPG 2.1.13 now uses "/run/user/$UID/gnupg/" as the default sockets
directory. This commit both update the path and cleans the way it was
handled by bash and zsh (why the hell was that done in different ways?).
https://lists.gnupg.org/pipermail/gnupg-announce/2016q2/000390.html
This commit is contained in:
Rodolphe Breard 2016-06-28 22:54:29 +02:00
parent 0858615d9c
commit 17f6bb0801
2 changed files with 6 additions and 9 deletions

View file

@ -36,12 +36,10 @@ else
fi
# GPG Agent
if [ -f "${HOME}/.gpg-agent-info" ]; then
. "${HOME}/.gpg-agent-info"
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
fi
export GPG_TTY=$(tty)
export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent"
export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh"
export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent)
# Aliases
[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"

7
.zshrc
View file

@ -41,10 +41,9 @@ fi
# GPG Agent
export GPG_TTY=$(tty)
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
fi
export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent"
export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh"
export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent)
# Aliases
[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"