diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2016-09-04 23:15:13 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2016-09-04 23:15:13 -0500 |
commit | 125cf0a7f2acb909b15193d5806d605eaa3cb278 (patch) | |
tree | 4fd4fea8b912e6b3d74b399fe9473e389eef369b /tdecore/tdehw/tdecryptographiccarddevice.cpp | |
parent | 28725494990cd4eb269dad09d5e2b5908047f546 (diff) | |
download | tdelibs-125cf0a7f2acb909b15193d5806d605eaa3cb278.tar.gz tdelibs-125cf0a7f2acb909b15193d5806d605eaa3cb278.zip |
Make cryptographic card reader detection on single readers sytems more robust
Diffstat (limited to 'tdecore/tdehw/tdecryptographiccarddevice.cpp')
-rw-r--r-- | tdecore/tdehw/tdecryptographiccarddevice.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.cpp b/tdecore/tdehw/tdecryptographiccarddevice.cpp index 4e3e6f77d..919a708e2 100644 --- a/tdecore/tdehw/tdecryptographiccarddevice.cpp +++ b/tdecore/tdehw/tdecryptographiccarddevice.cpp @@ -171,10 +171,17 @@ void CryptoCardDeviceWatcher::run() { SCardDisconnect(hCard, SCARD_LEAVE_CARD); } - if (!readers[i].contains(cardDevice->friendlyName())) { - if (!cardDevice->friendlyName().contains(reader_vendor_name) || - ((reader_interface_type != "") && !cardDevice->friendlyName().contains(reader_vendor_name))) { - continue; + /* FIXME + * If only one reader was detected by PCSC, assume it corresponds to the current device node. + * This is fragile, but avoids corner cases with common systems failing to work due to + * mismatched udev / PCSC card reader vendor names... + */ + if (readers.count() > 1) { + if (!readers[i].contains(cardDevice->friendlyName())) { + if (!cardDevice->friendlyName().contains(reader_vendor_name) || + ((reader_interface_type != "") && !cardDevice->friendlyName().contains(reader_vendor_name))) { + continue; + } } } |