aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2013-03-25 23:43:15 +0000
committerNIIBE Yutaka <[email protected]>2013-03-25 23:43:15 +0000
commited0328d49ad7d3361e608330205c92a06a508d06 (patch)
tree1d30a2a0f9f1134190253e9fa5ea4251592e4fc5
parentscd: PC/SC cleanup. (diff)
downloadgnupg-ed0328d49ad7d3361e608330205c92a06a508d06.tar.gz
gnupg-ed0328d49ad7d3361e608330205c92a06a508d06.zip
scd: call update_card_removed only when detecting removal.
* scd/command.c (update_reader_status_file): Add condition ss->status == 0. -- To reproduce the bug: (1) insert card, (2) run "gpg2 --card-status", (3) remove card, (4) invoke "gpg2 --card-edit", (5) invoke some command like "verify" The last step fails (but with no error message to user).
-rw-r--r--scd/command.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/scd/command.c b/scd/command.c
index e45153f1b..fc1f5a20e 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -2310,10 +2310,8 @@ update_reader_status_file (int set_card_removed_flag)
xfree (homestr);
}
- /* Set the card removed flag for all current sessions. We
- will set this on any card change because a reset or
- SERIALNO request must be done in any case. */
- if (ss->any && set_card_removed_flag)
+ /* Set the card removed flag for all current sessions. */
+ if (ss->any && ss->status == 0 && set_card_removed_flag)
update_card_removed (idx, 1);
ss->any = 1;