New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #38951 (new defect)

Opened 18 months ago

Last modified 7 months ago

rdesktop +smartcard: Undefined symbols: "_SCARD_CTL_CODE"

Reported by: ian.cheong@… Owned by: cshbell@…
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: ritchymad@…
Port: rdesktop

Description (last modified by macsforever2000@…) (diff)

Trying to build rdesktop +smartcard on Snow Leopard. Only two errors.

  1. trying to look for lib64, which apparently does not exist on MacOS

fudged past that one by making a symlink /opt/local/lib64->/opt/local/lib

  1. missing symbols ??from pcsc-lite
    :info:build Undefined symbols:
    :info:build   "_SCARD_CTL_CODE", referenced from:
    :info:build       _TS_SCardControl in scard.o
    :info:build       _TS_SCardControl in scard.o
    :info:build ld: symbol(s) not found

I had been playing around with various fixes including some suggestions found that rdesktop 1.6.x worked and grafting in some code from scard.c from 1.6

Previous to try rdesktop, I had been trying FreeRDP without success. So I did manage to get rdesktop +smartcard to build...

$ sudo port install rdesktop +smartcard
--->  Computing dependencies for rdesktop
--->  Building rdesktop
--->  Staging rdesktop into destroot
--->  Installing rdesktop @1.7.1_0+smartcard
--->  Activating rdesktop @1.7.1_0+smartcard
--->  Cleaning rdesktop
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

And I could talk to RDP server with smartcard showing up. In trying to document what the fix was, I cleaned out the macports install and tried to replicate the necessary parts and can't get it to work again yet : (

Change History

comment:1 Changed 18 months ago by ian.cheong@…

Have rolled back to 1.6 rev 83402. All seems fine with smart card support.

(sorry about formatting of first post)

comment:2 Changed 18 months ago by ian.cheong@…

Further testing reveals some problems with rdesktop 1.6 rev 83402:

  1. Smart card availability seems to have compatibility issues. Card will talk to SafeSign token administration utility using Gemalto card reader., but not to Gemalto SmartDiag or Safesign.
  2. Keyboard has intermittent hangs for several seconds.

Since 1.7.1 is meant to be better with Win 2008R2 and 64 bit, I will try again to get it to build...

comment:3 Changed 18 months ago by ian.cheong@…

Minimal fix to get rdesktop 1.7.1 + smartcard to build. Seems to still recognise smart card at least partially for SafeSign token administration utility

  1. fudge to non-existent lib64 problem with:
    $ sudo ln -s /opt/local/lib /opt/local/lib64
  2. comment out part with missing symbols in scard.o. diff file content
--- 1.7.1-src/scard.c	2011-12-07 19:49:44.000000000 +1000
+++ irc-1.7.1-works/scard.c	2013-05-02 20:22:05.000000000 +1000
@@ -2152,7 +2152,9 @@
 		/* Translate to local encoding */
 		dwControlCode = (dwControlCode & 0x3ffc) >> 2;
-		dwControlCode = SCARD_CTL_CODE(dwControlCode);
+/*IRC try rid of this
+dwControlCode = SCARD_CTL_CODE(dwControlCode);
@@ -2197,6 +2199,7 @@
 		DEBUG_SCARD(("SCARD: -> Success (out: %d bytes)\n", (int) nBytesReturned));
+/* IRC try rid of this
 	if (dwControlCode == SCARD_CTL_CODE(3400))
@@ -2214,6 +2217,7 @@
 	out_uint32_le(out, nBytesReturned);
 	out_uint32_le(out, 0x00000004);

There is a reference to removing definition of SCARD_CTL_CODE in 2005 revisions of MacOS Smart Card Services.

comment:4 Changed 17 months ago by macsforever2000@…

  • Owner changed from macports-tickets@… to cshbell@…
  • Port set to rdesktop
  • Description modified (diff)

In the future, please fill in the Port field and Cc the port maintainer(s).

comment:5 Changed 7 months ago by ryandesign@…

  • Cc ritchymad@… added
  • Summary changed from rdesktop +smartcard errors on 10.6.8 64bit to rdesktop +smartcard: Undefined symbols: "_SCARD_CTL_CODE"

Has duplicate #43110.

comment:6 Changed 7 months ago by ritchymad@…

It seems the same error is now in version 1.7.1_1 . Could please adjust for this version to fix the port for smartcard?

Note: See TracTickets for help on using tickets.