Bug 3115 - opensc no longer works with libpcsctun
Summary: opensc no longer works with libpcsctun
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Smart card (show other bugs)
Version: 2.1.0
Hardware: PC All
: P2 Normal
Target Milestone: 4.1.0
Assignee: Karl Mikaelsson
Keywords: astrand_tester
Depends on:
Reported: 2009-04-29 14:54 CEST by Pierre Ossman
Modified: 2013-05-20 15:44 CEST (History)
0 users

See Also:
Acceptance Criteria:


Description Pierre Ossman cendio 2009-04-29 14:54:52 CEST
Someone in the OpenSC project apparently didn't think that normal dynamic linking was fancy enough, so recent versions use dlopen() and dlsym() to set up the connection to PCSC-lite. And those command do not respect LD_LIBRARY_PATH, so our smart card tunneling stops working.

There is a configuration option "provider_library" though that can make opensc open our library. This isn't as elegant though as it provides no room for multi-arch systems, and it means that opensc will no longer work locally on the machine.

We need to document this mess.
Comment 1 Peter Åstrand cendio 2010-01-19 11:48:23 CET
See issue9942. 
Comment 2 Peter Åstrand cendio 2010-06-29 10:54:58 CEST
Checked this again today on my F11 system. Setting:

provider_library = libpcsclite.so.1

...in /etc/opensc.conf causes it to use /opt/thinlinc/lib/libpcsclite.so, but since this is a 64 bit system, this is wrong. Instead I have to manually set it to 
Comment 3 Pierre Ossman cendio 2012-12-07 11:07:15 CET
The bug causing this is in libtool (which opensc uses). Unlike dlopen(), lt_dlopen() will try to open the first matching library it finds and then give up. So when it fails to load the 32-bit one, it won't continue and try the 64-bit version.

Our solution to this is changing the order of the paths in our LD_LIBRARY_PATH. This will make it work for almost all cases as a 64-bit system will find the 64-bit libpcsctun, and a 32-bit system won't have the lib64 version to cause problems.
Comment 4 Karl Mikaelsson cendio 2013-03-20 15:07:38 CET
When solving this, make sure we test https://www.cendio.com/bugzilla/show_bug.cgi?id=2736 at the same time.
Comment 5 Karl Mikaelsson cendio 2013-04-12 11:17:51 CEST
Fixed in r27045.

Whiteboard includes time spent testing bug 2736 and investigating a pcsctun regression (bug 4593, bug 4510).
Comment 6 Peter Åstrand cendio 2013-05-20 15:44:03 CEST
Works fine on RHEL6.

Note You need to log in before you can comment on or make changes to this bug.