aboutsummaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog9
-rw-r--r--agent/call-scd.c11
-rw-r--r--agent/gpg-agent.c2
3 files changed, 21 insertions, 1 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index 68accb88e..0bca557c9 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,12 @@
+2010-05-03 Werner Koch <[email protected]>
+
+ * gpg-agent.c (check_own_socket_thread): Do not release SOCKNAME
+ too early.
+
+2010-03-17 Werner Koch <[email protected]>
+
+ * call-scd.c (unlock_scd): Send a BYE under certain conditions.
+
2010-02-19 Werner Koch <[email protected]>
* call-pinentry.c (start_pinentry): Remove a translation prefix.
diff --git a/agent/call-scd.c b/agent/call-scd.c
index f3303c11d..93f1cf742 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -176,6 +176,17 @@ agent_scd_dump_state (void)
static int
unlock_scd (ctrl_t ctrl, int rc)
{
+ if (gpg_err_code (rc) == GPG_ERR_NOT_OPERATIONAL
+ && gpg_err_source (rc) == GPG_ERR_SOURCE_SCD)
+ {
+ /* If the SCdaemon returned this error, it detected a major
+ problem, like no reader connected. To finish this we need to
+ stop the connection. This simulates an explicit killing of
+ the SCdaemon. */
+ assuan_transact (primary_scd_ctx, "BYE",
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ }
+
if (ctrl->scd_local->locked != 1)
{
log_error ("unlock_scd: invalid lock count (%d)\n",
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 73f84ed82..eec2ca1e0 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -2101,7 +2101,6 @@ check_own_socket_thread (void *arg)
check_own_socket_running++;
rc = assuan_new (&ctx);
- xfree (sockname);
if (rc)
{
log_error ("can't allocate assuan context: %s\n", gpg_strerror (rc));
@@ -2137,6 +2136,7 @@ check_own_socket_thread (void *arg)
xfree (buffer);
leave:
+ xfree (sockname);
if (ctx)
assuan_release (ctx);
if (rc)