aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-06-03 13:57:24 +0000
committerWerner Koch <[email protected]>2005-06-03 13:57:24 +0000
commitf1dac8851d02a0cb63fc7379ee74692856d0cf39 (patch)
tree79a731b1da742fe64ab4ee7fbca09f439954c032 /agent/command.c
parentAdd stuff from gnulib. (diff)
downloadgnupg-f1dac8851d02a0cb63fc7379ee74692856d0cf39.tar.gz
gnupg-f1dac8851d02a0cb63fc7379ee74692856d0cf39.zip
* command.c (cmd_updatestartuptty): New.
* gpg-agent.c: New option --write-env-file. * gpg-agent.c (handle_connections): Make sure that the signals we are handling are not blocked.Block signals while creating new threads. * estream.c: Use HAVE_CONFIG_H and not USE_CONFIG_H! (es_func_fd_read, es_func_fd_write): Protect against EINTR. * gpg-agent.texi (Agent UPDATESTARTUPTTY): New. * scdaemon.c (handle_connections): Make sure that the signals we are handling are not blocked.Block signals while creating new threads. (handle_connections): Include the file descriptor into the name of the thread.
Diffstat (limited to '')
-rw-r--r--agent/command.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c
index 8af159f6d..56167118d 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -868,6 +868,39 @@ cmd_scd (ASSUAN_CONTEXT ctx, char *line)
+/* UPDATESTARTUPTTY
+
+ Set startup TTY and X DISPLAY variables to the values of this
+ session. This command is useful to pull future pinentries to
+ another screen. It is only required because there is no way in the
+ ssh-agent protocol to convey this information. */
+static int
+cmd_updatestartuptty (assuan_context_t ctx, char *line)
+{
+ ctrl_t ctrl = assuan_get_pointer (ctx);
+
+ xfree (opt.startup_display); opt.startup_display = NULL;
+ xfree (opt.startup_ttyname); opt.startup_ttyname = NULL;
+ xfree (opt.startup_ttytype); opt.startup_ttytype = NULL;
+ xfree (opt.startup_lc_ctype); opt.startup_lc_ctype = NULL;
+ xfree (opt.startup_lc_messages); opt.startup_lc_messages = NULL;
+
+ if (ctrl->display)
+ opt.startup_display = xtrystrdup (ctrl->display);
+ if (ctrl->ttyname)
+ opt.startup_ttyname = xtrystrdup (ctrl->ttyname);
+ if (ctrl->ttytype)
+ opt.startup_ttytype = xtrystrdup (ctrl->ttytype);
+ if (ctrl->lc_ctype)
+ opt.startup_lc_ctype = xtrystrdup (ctrl->lc_ctype);
+ if (ctrl->lc_messages)
+ opt.startup_lc_messages = xtrystrdup (ctrl->lc_messages);
+
+ return 0;
+}
+
+
+
static int
option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value)
{
@@ -957,6 +990,7 @@ register_commands (ASSUAN_CONTEXT ctx)
{ "INPUT", NULL },
{ "OUTPUT", NULL },
{ "SCD", cmd_scd },
+ { "UPDATESTARTUPTTY", cmd_updatestartuptty },
{ NULL }
};
int i, rc;