diff options
author | Werner Koch <[email protected]> | 2014-12-19 12:07:09 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-12-19 12:07:09 +0000 |
commit | 14601eacb51f6c8a60d3d57aee1be11debd94c68 (patch) | |
tree | 7c483a13e8cc474f21ef90f6d3c86220887c6fe8 /agent/command.c | |
parent | agent: Fix string prepended to remotely initiated prompts. (diff) | |
download | gnupg-14601eacb51f6c8a60d3d57aee1be11debd94c68.tar.gz gnupg-14601eacb51f6c8a60d3d57aee1be11debd94c68.zip |
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 <[email protected]>
Diffstat (limited to 'agent/command.c')
-rw-r--r-- | agent/command.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c index eba766bc4..da7e50857 100644 --- a/agent/command.c +++ b/agent/command.c @@ -3113,6 +3113,12 @@ start_command_handler (ctrl_t ctrl, gnupg_fd_t listen_fd, gnupg_fd_t fd) int rc; assuan_context_t ctx = NULL; + if (ctrl->restricted) + { + if (agent_copy_startup_env (ctrl)) + return; + } + rc = assuan_new (&ctx); if (rc) { |