[svn] GnuPG - r5481 - in trunk: . agent
svn author wk
cvs at cvs.gnupg.org
Thu Nov 11 16:07:38 CET 2010
Author: wk
Date: 2010-11-11 16:07:37 +0100 (Thu, 11 Nov 2010)
New Revision: 5481
Modified:
trunk/NEWS
trunk/agent/ChangeLog
trunk/agent/agent.h
trunk/agent/call-scd.c
trunk/agent/gpg-agent.c
Log:
Fix bug where scdaemon kills a non-daemon gpg-agent.
Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog 2010-11-10 12:49:39 UTC (rev 5480)
+++ trunk/agent/ChangeLog 2010-11-11 15:07:37 UTC (rev 5481)
@@ -1,3 +1,9 @@
+2010-11-11 Werner Koch <wk at g10code.com>
+
+ * agent.h (opt): Add field SIGUSR2_ENABLED.
+ * gpg-agent.c (handle_connections): Set that flag.
+ * call-scd.c (start_scd): Enable events depending on this flag.
+
2010-10-27 Werner Koch <wk at g10code.com>
* gpg-agent.c (create_socket_name): Use TMPDIR. Change callers.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-11-10 12:49:39 UTC (rev 5480)
+++ trunk/NEWS 2010-11-11 15:07:37 UTC (rev 5481)
@@ -4,7 +4,10 @@
* TMPDIR is now also honored when creating a socket using
--no-standard-socket and with symcryptrun's temp files.
+ * Fixed a bug where Scdaemon sends a signal to Gpg-agent running in
+ non-daemon mode.
+
Noteworthy changes in version 2.1.0beta1 (2010-10-26)
-----------------------------------------------------
Modified: trunk/agent/agent.h
===================================================================
--- trunk/agent/agent.h 2010-11-10 12:49:39 UTC (rev 5480)
+++ trunk/agent/agent.h 2010-11-11 15:07:37 UTC (rev 5481)
@@ -58,6 +58,9 @@
/* True if we are listening on the standard socket. */
int use_standard_socket;
+ /* True if we handle sigusr2. */
+ int sigusr2_enabled;
+
/* Environment setting gathered at program start or changed using the
Assuan command UPDATESTARTUPTTY. */
session_env_t startup_env;
Modified: trunk/agent/call-scd.c
===================================================================
--- trunk/agent/call-scd.c 2010-11-10 12:49:39 UTC (rev 5480)
+++ trunk/agent/call-scd.c 2010-11-11 15:07:37 UTC (rev 5481)
@@ -399,17 +399,18 @@
/* Tell the scdaemon we want him to send us an event signal. We
don't support this for W32CE. */
#ifndef HAVE_W32CE_SYSTEM
- {
- char buf[100];
-
+ if (opt.sigusr2_enabled)
+ {
+ char buf[100];
+
#ifdef HAVE_W32_SYSTEM
- snprintf (buf, sizeof buf, "OPTION event-signal=%lx",
- (unsigned long)get_agent_scd_notify_event ());
+ snprintf (buf, sizeof buf, "OPTION event-signal=%lx",
+ (unsigned long)get_agent_scd_notify_event ());
#else
- snprintf (buf, sizeof buf, "OPTION event-signal=%d", SIGUSR2);
+ snprintf (buf, sizeof buf, "OPTION event-signal=%d", SIGUSR2);
#endif
- assuan_transact (ctx, buf, NULL, NULL, NULL, NULL, NULL, NULL);
- }
+ assuan_transact (ctx, buf, NULL, NULL, NULL, NULL, NULL, NULL);
+ }
#endif /*HAVE_W32CE_SYSTEM*/
primary_scd_ctx = ctx;
Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c 2010-11-10 12:49:39 UTC (rev 5480)
+++ trunk/agent/gpg-agent.c 2010-11-11 15:07:37 UTC (rev 5481)
@@ -1894,6 +1894,10 @@
#endif
time_ev = NULL;
+ /* Set a flag to tell call-scd.c that it may enable event
+ notifications. */
+ opt.sigusr2_enabled = 1;
+
FD_ZERO (&fdset);
FD_SET (FD2INT (listen_fd), &fdset);
nfd = FD2INT (listen_fd);
More information about the Gnupg-commits
mailing list