diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2013-03-26 00:43:15 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2013-03-26 00:57:22 +0100 |
commit | 1062893832bb15eaac853f52e1cb673e5e03790a (patch) | |
tree | 68afe22956438984ce34b37de59975b68c56c281 /scd | |
parent | scd: PC/SC cleanup. (diff) | |
download | gnupg2-1062893832bb15eaac853f52e1cb673e5e03790a.tar.xz gnupg2-1062893832bb15eaac853f52e1cb673e5e03790a.zip |
scd: call update_card_removed only when detecting removal.
* scd/command.c (update_reader_status_file): Add condition
vr->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).
Diffstat (limited to 'scd')
-rw-r--r-- | scd/command.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scd/command.c b/scd/command.c index 6267bb0cd..d5cc32cd9 100644 --- a/scd/command.c +++ b/scd/command.c @@ -2365,10 +2365,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 (vr->any && set_card_removed_flag) + /* Set the card removed flag for all current sessions. */ + if (vr->any && vr->status == 0 && set_card_removed_flag) update_card_removed (idx, 1); vr->any = 1; |