1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-14 21:47:19 +02:00

Revert SCD changes of 2010-05-03 (scd/ChangeLog 2010-03-17).

* scd/apdu.c (pcsc_no_service): Remove.
(open_pcsc_reader_direct, open_pcsc_reader_wrapped): Remove
pcsc_no_service support.
(apdu_open_reader): Remove R_NO_SERVICE.
* scd/apdu.h (apdu_open_reader): Remove R_NO_SERVICE.
* scd/command.c (reader_disabled): Remove.
(get_reader_slot): Follow the change of R_NO_SERVICE.
(open_card, cmd_serialno, scd_command_handler): Remove reader_disabled
support.
* scd/sc-copykeys.c (main): Follow the change of R_NO_SERVICE.
--
Daemon should handle all possible cases.  Even if such a difficult
case like reader_disabled, it should not exit.
This commit is contained in:
NIIBE Yutaka 2012-12-07 10:31:37 +09:00
parent 9afd2bb7fb
commit 0d7cf7bb06
4 changed files with 9 additions and 44 deletions

View file

@ -74,10 +74,6 @@
&& (c)->reader_slot == locked_session->ctrl_backlink->reader_slot)
/* Flag indicating that the reader has been disabled. */
static int reader_disabled;
/* This structure is used to keep track of open readers (slots). */
struct slot_status_s
{
@ -414,14 +410,7 @@ get_reader_slot (void)
/* Try to open the reader. */
if (ss->slot == -1)
{
int no_service_flag;
ss->slot = apdu_open_reader (opt.reader_port, &no_service_flag);
if (no_service_flag)
{
log_info ("no card services - disabling scdaemon\n");
reader_disabled = 1;
}
ss->slot = apdu_open_reader (opt.reader_port);
/* If we still don't have a slot, we have no readers.
Invalidate for now until a reader is attached. */
@ -444,9 +433,6 @@ open_card (ctrl_t ctrl, const char *apptype)
gpg_error_t err;
int slot;
if (reader_disabled)
return gpg_error (GPG_ERR_NOT_OPERATIONAL);
/* If we ever got a card not present error code, return that. Only
the SERIALNO command and a reset are able to clear from that
state. */
@ -479,7 +465,7 @@ open_card (ctrl_t ctrl, const char *apptype)
slot = get_reader_slot ();
ctrl->reader_slot = slot;
if (slot == -1)
err = gpg_error (reader_disabled? GPG_ERR_NOT_OPERATIONAL: GPG_ERR_CARD);
err = gpg_error (GPG_ERR_CARD);
else
{
/* Fixme: We should move the apdu_connect call to
@ -537,7 +523,7 @@ cmd_serialno (assuan_context_t ctx, char *line)
/* Clear the remove flag so that the open_card is able to reread it. */
retry:
if (!reader_disabled && ctrl->server_local->card_removed)
if (ctrl->server_local->card_removed)
{
if ( IS_LOCKED (ctrl) )
return gpg_error (GPG_ERR_LOCKED);
@ -2066,7 +2052,7 @@ scd_command_handler (ctrl_t ctrl, int fd)
BUG ();
sl->next_session = ctrl->server_local->next_session;
}
stopme = ctrl->server_local->stopme || reader_disabled;
stopme = ctrl->server_local->stopme;
xfree (ctrl->server_local);
ctrl->server_local = NULL;