|
1 Upstream fix that will be included in another release of pcsclite. |
|
2 |
|
3 From 9d0438ae384c33276d671cdf0830fe5d51901192 Mon Sep 17 00:00:00 2001 |
|
4 From: Ludovic Rousseau <[email protected]> |
|
5 Date: Fri, 18 Mar 2016 13:29:35 +0100 |
|
6 Subject: [PATCH] libusb hotplug: handle error in parsing drivers |
|
7 |
|
8 If HPReadBundleValues() returned an error (-1) it was considered as a |
|
9 correct value in HPSearchHotPluggables() |
|
10 |
|
11 We now check that at least 1 driver has been found. |
|
12 |
|
13 Thanks to Maksim Ivanov for the bug report |
|
14 https://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160314/000550.html |
|
15 --- |
|
16 src/hotplug_libusb.c | 6 ++---- |
|
17 1 file changed, 2 insertions(+), 4 deletions(-) |
|
18 |
|
19 diff --git a/src/hotplug_libusb.c b/src/hotplug_libusb.c |
|
20 index 71d5192..eff8519 100644 |
|
21 --- a/src/hotplug_libusb.c |
|
22 +++ b/src/hotplug_libusb.c |
|
23 @@ -263,19 +263,17 @@ static LONG HPReadBundleValues(void) |
|
24 driverSize = listCount; |
|
25 closedir(hpDir); |
|
26 |
|
27 - rv = TRUE; |
|
28 if (driverSize == 0) |
|
29 { |
|
30 Log1(PCSC_LOG_INFO, "No bundle files in pcsc drivers directory: " PCSCLITE_HP_DROPDIR); |
|
31 Log1(PCSC_LOG_INFO, "Disabling USB support for pcscd"); |
|
32 - rv = FALSE; |
|
33 } |
|
34 #ifdef DEBUG_HOTPLUG |
|
35 else |
|
36 Log2(PCSC_LOG_INFO, "Found drivers for %d readers", listCount); |
|
37 #endif |
|
38 |
|
39 - return rv; |
|
40 + return driverSize; |
|
41 } |
|
42 |
|
43 static void HPRescanUsbBus(void) |
|
44 @@ -490,7 +488,7 @@ LONG HPSearchHotPluggables(void) |
|
45 readerTracker[i].fullName = NULL; |
|
46 } |
|
47 |
|
48 - if (HPReadBundleValues()) |
|
49 + if (HPReadBundleValues() > 0) |
|
50 { |
|
51 int pipefd[2]; |
|
52 char c; |
|
53 -- |
|
54 1.9.1 |
|
55 |