summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2023-04-12 22:23:51 +0200
committerDavid Härdeman <david@hardeman.nu>2023-04-13 17:09:08 +0200
commite5b52d51d301bf19efc4211f2fa9f256f64a2a29 (patch)
treee2e869a9596dc6a73d130263772fea99f6618bc7
parentdc493ec16ec7e1d31eff91d922e9d3a38a5b7681 (diff)
downloadgnome-settings-daemon-e5b52d51d301bf19efc4211f2fa9f256f64a2a29.tar.gz
smartcard: check for the addition of new smartcard readers
gsd-smartcard currently checks for the insertion/removal of smartcards in reader devices which where present at the time gsd-smartcard was started, but does not account for new smartcard readers appearing after gsd-smartcard was started. This patch adds support for checking for the addition of new slots (i.e. smartcard readers), which is necessary to support devices like the Yubikey (a "reader" and a smartcard) which may be inserted after gsd-smartcard was started.
-rw-r--r--plugins/smartcard/gsd-smartcard-manager.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/smartcard/gsd-smartcard-manager.c b/plugins/smartcard/gsd-smartcard-manager.c
index acd22df8..a219e22e 100644
--- a/plugins/smartcard/gsd-smartcard-manager.c
+++ b/plugins/smartcard/gsd-smartcard-manager.c
@@ -212,7 +212,12 @@ watch_one_event_from_driver (GsdSmartcardManager *self,
error_code = PORT_GetError ();
if (error_code == SEC_ERROR_NO_EVENT) {
- g_usleep (1 * G_USEC_PER_SEC);
+ int old_slot_count = operation->driver->slotCount;
+ SECMOD_UpdateSlotList (operation->driver);
+ if (operation->driver->slotCount != old_slot_count)
+ g_debug ("Slot count change %i -> %i", old_slot_count, operation->driver->slotCount);
+ else
+ g_usleep (1 * G_USEC_PER_SEC);
return TRUE;
}