Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle short-lived removals of reader in reader driver for PC/SC #2803

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
reader-pcsc: remove flag for removed reader
When SCardGetStatusChange returns value successfully,
remove also SC_READER_REMOVED before setting the current state.
  • Loading branch information
xhanulik committed Mar 20, 2024
commit 639fa57c60ff07e07d3b9037074b964f243d6c9b
2 changes: 1 addition & 1 deletion src/libopensc/reader-pcsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static int refresh_attributes(sc_reader_t *reader)
SC_FUNC_RETURN(reader->ctx, SC_LOG_DEBUG_VERBOSE, SC_SUCCESS);
}

reader->flags &= ~(SC_READER_CARD_CHANGED|SC_READER_CARD_INUSE|SC_READER_CARD_EXCLUSIVE);
reader->flags &= ~(SC_READER_CARD_CHANGED|SC_READER_CARD_INUSE|SC_READER_CARD_EXCLUSIVE|SC_READER_REMOVED);

if (state & SCARD_STATE_PRESENT) {
reader->flags |= SC_READER_CARD_PRESENT;
Expand Down