aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2016-09-03 06:27:30 +0000
committerNIIBE Yutaka <[email protected]>2016-11-30 00:17:21 +0000
commit68d3e461f67404d1b47dfa7b9efdb6ac2c087bb7 (patch)
treea42b4fce77aa65a56ddb5bfc1596178c230fa5a7
parentscd: Release the card reader after card removal. (diff)
downloadgnupg-68d3e461f67404d1b47dfa7b9efdb6ac2c087bb7.tar.gz
gnupg-68d3e461f67404d1b47dfa7b9efdb6ac2c087bb7.zip
scd: Fix an action after card removal.
* scd/command.c (update_card_removed): Call apdu_close_reader here. -- Backport of master commit: f9e49c80e706a27d5e30d4b3237ff26367a67130 This is update of the commit 8fe81055762d9c9e6f03fb7853a985c94ef73ac3 It is better apdu_close_reader is called in update_card_removed. The commit 1598a4476466822e7e9c757ac471089d3db4b545 introduced a regression, it doesn't close the reader after removal of the card, while the code before the commit call apdu_close_reader in do_reset. So, this fix. GnuPG-bug-id: 2449 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--scd/command.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/scd/command.c b/scd/command.c
index e35579edc..963cb3e22 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -200,6 +200,7 @@ update_card_removed (int slot, int value)
if (value)
{
log_debug ("Removal of a card: %d\n", slot);
+ apdu_close_reader (slot);
application_notify_card_reset (slot);
slot_table[slot].slot = -1;
}
@@ -2315,10 +2316,7 @@ update_reader_status_file (int set_card_removed_flag)
/* Set the card removed flag for all current sessions. */
if (ss->any && ss->status == 0 && set_card_removed_flag)
- {
- apdu_close_reader (ss->slot);
- update_card_removed (ss->slot, 1);
- }
+ update_card_removed (ss->slot, 1);
ss->any = 1;