Index: cackey.c ================================================================== --- cackey.c +++ cackey.c @@ -3109,11 +3109,13 @@ scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, pcsc_readers, &pcsc_readers_len); if (scard_listreaders_ret == SCARD_S_SUCCESS) { pcsc_readers_e = pcsc_readers + pcsc_readers_len; - currslot = 0; + /* Start with Slot ID 1, to avoid a bug in GDM */ + /* Bug 619297: https://bugzilla.gnome.org/show_bug.cgi?id=619297 */ + currslot = 1; while (pcsc_readers < pcsc_readers_e) { curr_reader_len = strlen(pcsc_readers); if ((pcsc_readers + curr_reader_len) > pcsc_readers_e) { break; @@ -3144,12 +3146,16 @@ currslot++; pcsc_readers += curr_reader_len + 1; } - if (currslot > 0) { - slot_count = currslot; + /* Start with Slot ID 1, to avoid a bug in GDM */ + /* Bug 619297: https://bugzilla.gnome.org/show_bug.cgi?id=619297 */ + if (currslot > 1) { + /* Start with Slot ID 1, to avoid a bug in GDM */ + /* Bug 619297: https://bugzilla.gnome.org/show_bug.cgi?id=619297 */ + slot_count = currslot - 1; } } else { CACKEY_DEBUG_PRINTF("Second call to SCardListReaders failed, return %s/%li", CACKEY_DEBUG_FUNC_SCARDERR_TO_STR(scard_listreaders_ret), (long) scard_listreaders_ret); } @@ -3180,11 +3186,13 @@ return(CKR_BUFFER_TOO_SMALL); } for (currslot = 0; currslot < slot_count; currslot++) { - pSlotList[currslot] = currslot; + /* Start with Slot ID 1, to avoid a bug in GDM */ + /* Bug 619297: https://bugzilla.gnome.org/show_bug.cgi?id=619297 */ + pSlotList[currslot] = currslot + 1; } *pulCount = slot_count; CACKEY_DEBUG_PRINTF("Returning CKR_OK (%i). Found %lu readers.", CKR_OK, (unsigned long) slot_count);