The rdesktop smart card implementation is very bad. It uses locks and threads apparently without reason, has a lot of dead code, and doesn't work correctly on 64 bit platforms. It smells ugly as well. Basically, it needs a complete rewrite.
*** Bug 4083 has been marked as a duplicate of this bug. ***
Found another reason for a rewrite. The RDP smart card protocol uses the DCE RPC standard for encoding calls. But rdesktop doesn't make any attempt to properly parse this. Instead it assumes a very fixed layout. This is bound to fail at some point.
(In reply to comment #2) > Found another reason for a rewrite. The RDP smart card protocol uses the DCE > RPC standard for encoding calls. But rdesktop doesn't make any attempt to > properly parse this. Instead it assumes a very fixed layout. This is bound to > fail at some point. This is no longer a theoretical problem. Bug 4741 is the first instance of this crappy parsing failing under real world scenarios.
See also bug 3571 about redesigning pcsctun to deal with pcsc-lite's crappiness. Probably need to use a similar design for rdesktop.
rdesktop (and associated tools) is being removed from the ThinLinc product.