summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2008-05-26 14:00:55 +0200
committerWerner Koch <wk@gnupg.org>2008-05-26 14:00:55 +0200
commit203ea19408f83296e52ab09d1380f59455cbc8ce (patch)
treebff9fafec151e20ff4ba45fd872ea417a2e7c775 /tools
parentFix --output option used when with --export-secret-kety-p12. (diff)
downloadgnupg2-203ea19408f83296e52ab09d1380f59455cbc8ce.tar.xz
gnupg2-203ea19408f83296e52ab09d1380f59455cbc8ce.zip
Make --runtime option of gpgconf under W32 work.
Diffstat (limited to 'tools')
-rw-r--r--tools/ChangeLog8
-rw-r--r--tools/gpg-connect-agent.c13
-rw-r--r--tools/gpgconf-comp.c17
3 files changed, 37 insertions, 1 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index a28b774da..357667415 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -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 ...
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index c76f0e219..2f173f930 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -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;
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index 5dc32d6eb..579025eac 100644
--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -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