[svn] GnuPG - r4769 - trunk/tools
svn author wk
cvs at cvs.gnupg.org
Mon May 26 14:00:57 CEST 2008
Author: wk
Date: 2008-05-26 14:00:55 +0200 (Mon, 26 May 2008)
New Revision: 4769
Modified:
trunk/tools/ChangeLog
trunk/tools/gpg-connect-agent.c
trunk/tools/gpgconf-comp.c
Log:
Make --runtime option of gpgconf under W32 work.
Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog 2008-05-26 10:39:56 UTC (rev 4768)
+++ trunk/tools/ChangeLog 2008-05-26 12:00:55 UTC (rev 4769)
@@ -1,3 +1,11 @@
+2008-05-26 Werner Koch <wk at 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 at g10code.de>
* gpgconf.h (gc_component_check_programs): Rename to ...
Modified: trunk/tools/gpg-connect-agent.c
===================================================================
--- trunk/tools/gpg-connect-agent.c 2008-05-26 10:39:56 UTC (rev 4768)
+++ trunk/tools/gpg-connect-agent.c 2008-05-26 12:00:55 UTC (rev 4769)
@@ -1134,6 +1134,7 @@
char *condition;
} loopstack[20];
int loopidx;
+ char **cmdline_commands = NULL;
gnupg_rl_initialize ();
set_strusage (my_strusage);
@@ -1191,7 +1192,7 @@
}
}
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 @@
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;
Modified: trunk/tools/gpgconf-comp.c
===================================================================
--- trunk/tools/gpgconf-comp.c 2008-05-26 10:39:56 UTC (rev 4768)
+++ trunk/tools/gpgconf-comp.c 2008-05-26 12:00:55 UTC (rev 4769)
@@ -1014,9 +1014,26 @@
/* 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
More information about the Gnupg-commits
mailing list