agent: Keep the session environment for restricted connections.
authorWerner Koch <wk@gnupg.org>
Fri, 19 Dec 2014 12:07:09 +0000 (13:07 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 19 Dec 2014 12:07:09 +0000 (13:07 +0100)
commit14601eacb51f6c8a60d3d57aee1be11debd94c68
tree7c483a13e8cc474f21ef90f6d3c86220887c6fe8
parentaad8963f7b9d13b319abd413db8f42ec467db913
agent: Keep the session environment for restricted connections.

* agent/command-ssh.c (setup_ssh_env): Move code to ...
* agent/gpg-agent.c (agent_copy_startup_env): .. new function.  Change
calllers.
* agent/command.c (start_command_handler): Call that fucntion for
restricted connections.
--

A remote connection is and should not be able to setup the local
session environment.  However, unless --keep-display is used we would
be left without an environment and thus pinentry can't be used.  The
fix is the same as used for ssh-agent connection: We use the default
environment as used at the startup of the agent.

Signed-off-by: Werner Koch <wk@gnupg.org>
agent/agent.h
agent/command-ssh.c
agent/command.c
agent/gpg-agent.c
common/session-env.c