Make --runtime option of gpgconf under W32 work.

This commit is contained in:
Werner Koch 2008-05-26 12:00:55 +00:00
parent ee3a1ec0d8
commit 203ea19408
3 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2008-05-26 Werner Koch <wk@g10code.com>
* gpgconf-comp.c (gpg_agent_runtime_change) [W32]: Issue
"reloadagent" command to gpg-agent.
* gpg-connect-agent.c (main): Allow server command on the command
line.
2008-05-20 Marcus Brinkmann <marcus@g10code.de>
* gpgconf.h (gc_component_check_programs): Rename to ...

View File

@ -1134,6 +1134,7 @@ main (int argc, char **argv)
char *condition;
} loopstack[20];
int loopidx;
char **cmdline_commands = NULL;
gnupg_rl_initialize ();
set_strusage (my_strusage);
@ -1191,7 +1192,7 @@ main (int argc, char **argv)
}
}
else if (argc)
usage (1);
cmdline_commands = argv;
if (opt.exec && opt.raw_socket)
log_info (_("option \"%s\" ignored due to \"%s\"\n"),
@ -1279,6 +1280,16 @@ main (int argc, char **argv)
else
log_fatal ("/end command vanished\n");
}
else if (cmdline_commands && *cmdline_commands && !script_fp)
{
keep_line = 0;
xfree (line);
line = xstrdup (*cmdline_commands);
cmdline_commands++;
n = strlen (line);
if (n >= maxlength)
maxlength = 0;
}
else if (use_tty && !script_fp)
{
keep_line = 0;

View File

@ -1014,9 +1014,26 @@ gpg_agent_runtime_change (void)
/* Ignore any errors here. */
kill (pid, SIGHUP);
#else
gpg_error_t err;
const char *pgmname;
const char *argv[2];
pid_t pid;
pgmname = gnupg_module_name (GNUPG_MODULE_NAME_CONNECT_AGENT);
argv[0] = "reloadagent";
argv[1] = NULL;
err = gnupg_spawn_process_fd (pgmname, argv, -1, -1, -1, &pid);
if (!err)
err = gnupg_wait_process (pgmname, pid, NULL);
if (err)
gc_error (0, 0, "error running `%s%s': %s",
pgmname, " reloadagent", gpg_strerror (err));
#endif /*!HAVE_W32_SYSTEM*/
}
/* More or less Robust version of dgettext. It has the side effect of
switching the codeset to utf-8 because this is what we want to