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).
This commit is contained in:
NIIBE Yutaka 2013-03-26 08:43:15 +09:00
parent ee95c23fcd
commit 1062893832
1 changed files with 2 additions and 4 deletions

View File

@ -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;