aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2016-07-20 02:35:05 +0000
committerNIIBE Yutaka <[email protected]>2016-07-20 02:35:05 +0000
commit1598a4476466822e7e9c757ac471089d3db4b545 (patch)
tree652f01c9efcd99562933e223d3d0b6121e85ec6b /scd/app.c
parentagent: Add known keys to sshcontrol. (diff)
downloadgnupg-1598a4476466822e7e9c757ac471089d3db4b545.tar.gz
gnupg-1598a4476466822e7e9c757ac471089d3db4b545.zip
scd: Fix card removal/reset on multiple contexts.
* scd/app.c (application_notify_card_reset): Add message for debug. *scd/command.c (update_card_removed): Call release_application and set SLOT -1 here. (struct server_local_s): Remove app_ctx_marked_for_release. (do_reset): Don't mark release but call release_application here. (open_card): Remove app_ctx_marked_for_release handling. (update_reader_status_file): Don't set SLOT here, so that it can be released the APP by application_notify_card_reset in update_card_removed. -- Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to '')
-rw-r--r--scd/app.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/scd/app.c b/scd/app.c
index 51464a2d8..55b8edd12 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -168,8 +168,12 @@ application_notify_card_reset (int slot)
/* Release the APP, as it's not reusable any more. */
if (lock_table[slot].app)
{
+ if (lock_table[slot].app->ref_count)
+ log_bug ("trying to release active context\n");
+
deallocate_app (lock_table[slot].app);
lock_table[slot].app = NULL;
+ log_debug ("application has been released\n");
}
unlock_reader (slot);