diff options
author | Werner Koch <[email protected]> | 2012-12-10 13:45:26 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2012-12-10 13:45:26 +0000 |
commit | 36ba7845995dd3caf8faeec3e09b3ffb879fc29b (patch) | |
tree | 5e4af488c4cff6fe8f956c34029f82aef34f2f17 /agent/command-ssh.c | |
parent | config: Update npth.m4. (diff) | |
download | gnupg-36ba7845995dd3caf8faeec3e09b3ffb879fc29b.tar.gz gnupg-36ba7845995dd3caf8faeec3e09b3ffb879fc29b.zip |
agent: Add envvar "gnupg_SSH_AUTH_SOCK_by"
* agent/gpg-agent.c (main): Pass new envar gnupg_SSH_AUTH_SOCK_by to
an invoked process.
--
This environment variable is useful for debugging if
--use-standard-socket is used (which is the default since 2.1).
Commonly you should have this in your init script (e.g. ~/.bashrc):
unset GPG_AGENT_INFO
unset SSH_AGENT_PID
SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
export SSH_AUTH_SOCK
The problem is that gpg-agent won't be able to override the
SSH_AUTH_SOCK envvar if gpg-agent has been invoked as
gpg-agent --enable-ssh-support --daemon /bin/bash
To fix this you should instead use this code in the init script:
unset GPG_AGENT_INFO
unset SSH_AGENT_PID
if [ ${gnupg_SSH_AUTH_SOCK_by:-0} -ne $$ ]; then
export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
fi
This will work in all cases and thus allows to start gpg-agent for
testing purposes with a different homedir and use this gpg-agent as an
ssh-agent. Example:
GNUPGHOME=$(pwd) gpg-agent --enable-ssh-support --daemon /bin/bash
gnupg_SSH_AUTH_SOCK_by is set to the PID of the exec-ed process and
thus will work safely if called recursively.
Diffstat (limited to 'agent/command-ssh.c')
0 files changed, 0 insertions, 0 deletions