aboutsummaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog13
-rw-r--r--agent/agent.h3
-rw-r--r--agent/call-scd.c17
-rw-r--r--agent/findkey.c5
-rw-r--r--agent/gpg-agent.c4
5 files changed, 31 insertions, 11 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index 6e1b45eee..1ca86bdbe 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-11 Werner Koch <[email protected]>
+
+ * 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-09-30 Werner Koch <[email protected]>
+
+ * findkey.c (unprotect): Do not put the passphrase into the cache
+ if it has been changed.
+
2010-09-24 Werner Koch <[email protected]>
* gpg-agent.c (main, reread_configuration): Always test whether
@@ -2551,7 +2562,7 @@ Fri Aug 18 14:27:14 CEST 2000 Werner Koch <[email protected]>
Copyright 2001, 2002, 2003, 2004, 2005,
- 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
diff --git a/agent/agent.h b/agent/agent.h
index 4a982a1b8..30af016d7 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -64,6 +64,9 @@ struct
/* True if we are listening on the standard socket. */
int use_standard_socket;
+ /* True if we handle sigusr2. */
+ int sigusr2_enabled;
+
const char *pinentry_program; /* Filename of the program to start as
pinentry. */
const char *scdaemon_program; /* Filename of the program to handle
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 365c955f4..5a43377ea 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -408,17 +408,18 @@ start_scd (ctrl_t ctrl)
}
/* Tell the scdaemon we want him to send us an event signal. */
- {
- 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);
+ }
primary_scd_ctx = ctx;
primary_scd_ctx_reusable = 0;
diff --git a/agent/findkey.c b/agent/findkey.c
index 9405342d1..5c933f71f 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -407,8 +407,9 @@ unprotect (ctrl_t ctrl, const char *desc_text,
return rc;
}
}
- agent_put_cache (hexgrip, cache_mode, pi->pin,
- lookup_ttl? lookup_ttl (hexgrip) : 0);
+ else
+ agent_put_cache (hexgrip, cache_mode, pi->pin,
+ lookup_ttl? lookup_ttl (hexgrip) : 0);
xfree (*keybuf);
*keybuf = arg.unprotected_key;
}
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 7e359479a..7671a5180 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1892,6 +1892,10 @@ handle_connections (gnupg_fd_t listen_fd, gnupg_fd_t listen_fd_ssh)
#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);