agent: fix for UPDATESTARTUPTTY
NIIBE Yutaka
gniibe at fsij.org
Thu Jul 4 05:41:53 CEST 2013
In 2.0.20, I found that:
$ gpg-connect-agent updatestartuptty /bye
doesn't work.
There are two problems for me.
(1) When I want to use pinentry for nterminal, there is no way,
if I already have gpg-agent with DISPLAY.
(2) UPDATESTARTUPTTY doesn't work to switch TTY for pinentry for SSH.
For (1), I think that we need to implement something to negate X
Window System.
Latter is simply a bug.
Current implementation:
In the function start_command_handler_ssh, the logic puts priority
on ctrl->session_env which is initialized by
agent_init_default_ctrl. There are always GPG_TTY and TERM
defined, because lines around 968 in gpg-agent.c, it says:
/* Make sure that we have a default ttyname. */
While UPDATESTARTUPTTY updates opt.startup_env, it doesn't affect
at all.
Here is a patch to point the issue. Tested and works for me.
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 2f96ef5..6009956 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -3025,8 +3025,7 @@ start_command_handler_ssh (ctrl_t ctrl, gnupg_fd_t sock_client)
const char *value;
for (idx=0; !err && names[idx]; idx++)
- if (!session_env_getenv (ctrl->session_env, names[idx])
- && (value = session_env_getenv (opt.startup_env, names[idx])))
+ if ((value = session_env_getenv (opt.startup_env, names[idx])))
err = session_env_setenv (ctrl->session_env, names[idx], value);
if (!err && !ctrl->lc_ctype && opt.startup_lc_ctype)
--
More information about the Gnupg-devel
mailing list