Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

rDesktop 1.7.0

Hi guys,


in this discussion https://discussions.apple.com/thread/1679181?threadID=1679181 was descriped,

that it’s possible to connect a smartcard from Mac to a Windows Server with the tool „rDesktop 1.6.0“.


Now there’s a new Client-version available: 1.7.0.


So I’d like to ask how to configure it, because it‘s impossible like this:


„cd Desktop/rdesktop-1.7.0 && ./configure --enable-smartcard -x-includes=/usr/X11/include-x-libraries=/usr/X11/lib && make && sudo make install“


Does anyone has some experience with this version?


Best regards

Jan

Posted on May 27, 2011 1:40 AM

Reply
65 replies

Jun 10, 2011 7:48 PM in response to jan0k

jan0k,

I'm the one that posted the rdesktop-1.6.0 with smartcard support instructions.


I'm still trying to compile and install rdesktop-1.7.0 with smartcard support. Unfortunately, there appears to be some kind of error in one of the source code files, "scard.c".


Until I can figure out a work-around, is there a reason why you can't use rdesktop-1.6.0?

Jun 14, 2011 1:46 AM in response to TRON

I’m very glad to hearing from you. Maybe you’re the right one 😁


Exact the same error occurs to me, so I asked you for help.


I’ve used rDesktop 1.6 but I need 1.7 to solve some bugs (blackmouse-cursor and printer-redirection).


I’m looking forward to hearing from you soon


Best regards

Jan

Jun 15, 2011 4:31 AM in response to jan0k

Jan,

I was able to compile and install rdesktop-1.7.0 using the steps below, but I have no way of testing if smartcard support works.


Edit the following rdesktop-1.7.0 files: scard.h, scard.c


In scard.h -

Add (without the quotation marks)


"int scard_enum_devices(uint32 * id, char *optarg);"


as the last line of the file, then save and close the file.


In scard.c -

Replace the current TS_SCardControl function with TS_SCardControl function from rdesktop-1.6.0:



TS_SCardControl(STREAM in, STREAM out)


{

MYPCSC_DWORD rv;

SERVER_SCARDCONTEXT hContext;

SERVER_SCARDHANDLE hCard;

MYPCSC_SCARDHANDLE myHCard;

SERVER_DWORD map[3];

SERVER_DWORD dwControlCode;

unsigned char *pInBuffer, *pOutBuffer;

SERVER_DWORD nInBufferSize, nOutBufferSize, nOutBufferRealSize, nBytesReturned;

MYPCSC_DWORD sc_nBytesReturned;

PMEM_HANDLE lcHandle = NULL;


pInBuffer = NULL;

pOutBuffer = NULL;


in->p += 0x14;

in_uint32_le(in, map[0]);

in->p += 0x04;

in_uint32_le(in, map[1]);

in_uint32_le(in, dwControlCode);

in_uint32_le(in, nInBufferSize);

in_uint32_le(in, map[2]);

in->p += 0x04;

in_uint32_le(in, nOutBufferSize);

in->p += 0x04;

in_uint32_le(in, hContext);

in->p += 0x04;

in_uint32_le(in, hCard);

if (map[2] & INPUT_LINKED)

{


/* read real input size */

in_uint32_le(in, nInBufferSize);

pInBuffer = SC_xmalloc(&lcHandle, nInBufferSize);

if (!pInBuffer)

return SC_returnNoMemoryError(&lcHandle, in, out);

in_uint8a(in, pInBuffer, nInBufferSize);

}


#if 0

if (nOutBufferSize > 0)

{

nOutBufferRealSize = nOutBufferSize;

}


else

#endif

nOutBufferRealSize = 1024;


nBytesReturned = nOutBufferRealSize;


nBytesReturned = nOutBufferRealSize;

pOutBuffer = SC_xmalloc(&lcHandle, nOutBufferRealSize);

if (!pOutBuffer)

return SC_returnNoMemoryError(&lcHandle, in, out);


DEBUG_SCARD(("SCARD: SCardControl(context: 0x%08x, hcard: 0x%08x, code: 0x%08x, in: %d bytes, out: %d bytes)\n", (unsigned) hContext, (unsigned) hCard, (unsigned) dwControlCode, (int) nInBufferSize, (int) nOutBufferSize));


sc_nBytesReturned = nBytesReturned;

myHCard = scHandleToMyPCSC(hCard);

#ifdef WITH_PCSC120

rv = SCardControl(myHCard, pInBuffer, (MYPCSC_DWORD) nInBufferSize, pOutBuffer,

&sc_nBytesReturned);

#else

rv = SCardControl(myHCard, (MYPCSC_DWORD) dwControlCode, pInBuffer,

(MYPCSC_DWORD) nInBufferSize, pOutBuffer,

(MYPCSC_DWORD) nOutBufferRealSize, &sc_nBytesReturned);

#endif

nBytesReturned = sc_nBytesReturned;


if (rv != SCARD_S_SUCCESS)

{

DEBUG_SCARD(("SCARD: -> Failure: %s (0x%08x)\n",

pcsc_stringify_error(rv), (unsigned int) rv));

}


else

{

DEBUG_SCARD(("SCARD: -> Success (out: %d bytes)\n", (int) nBytesReturned));

}


out_uint32_le(out, nBytesReturned);

out_uint32_le(out, 0x00000004);

out_uint32_le(out, nBytesReturned);

if (nBytesReturned > 0)

{

out_uint8p(out, pOutBuffer, nBytesReturned);

outRepos(out, nBytesReturned);

}


outForceAlignment(out, 8);

SC_xfreeallmemory(&lcHandle);


return rv;

}


After replacing the code, save and close the file and then launch your X11 application.

In the X11 window, "cd" to your rdesktop-1.7.0 folder then type:

./configure --enable-smartcard -x-includes=/usr/X11/include -x-libraries=/usr/X11/lib && make && sudo make install


then hit enter and give your admin password when prompted.

Please let me know if this helps. Good luck!

Jun 19, 2011 2:48 PM in response to jan0k

Jan,

I went back and replaced as man of the scard references in the 1.7.0 files with the scard references from 1.6.0.

I was able to compile this and install it, but I can't check if the smartcard support is back. My new version of the rdesktop-1.7.0 files can be downloaded here:

https://files.me.com/captarendt/l3scpk


You can re-compile the files yourself, or just try the "make && sudo make install" procedure. Good luck!

Jul 26, 2011 5:16 AM in response to TRON

thank you, but i can't build it anyway. can i ask you for assistance once more?


Undefined symbols:

"_iconv", referenced from:

_ui_clip_handle_data in xclip.o

_xclip_send_data_with_convert in xclip.o

_rdp_out_unistr in rdp.o

_rdp_out_unistr in rdp.o

_rdp_in_unistr in rdp.o

"_iconv_close", referenced from:

_ui_clip_handle_data in xclip.o

_ui_clip_handle_data in xclip.o

_xclip_send_data_with_convert in xclip.o

_rdp_out_unistr in rdp.o

_rdp_out_unistr in rdp.o

_rdp_in_unistr in rdp.o

"_iconv_open", referenced from:

_ui_clip_handle_data in xclip.o

_xclip_send_data_with_convert in xclip.o

_xclip_send_data_with_convert in xclip.o

_xclip_send_data_with_convert in xclip.o

_rdp_out_unistr in rdp.o

_rdp_in_unistr in rdp.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

make: *** [rdesktop] Error 1


i've got libiconv installed and it seems that it have this functions. tried to google it, but found only macports discussions.

Jul 27, 2011 12:29 PM in response to muc2810

Unfortunately, I have not upgraded to Lion yet, since Apple decided to deprecate SmartCard services with Lion. That means there is no native SmartCard support in Lion, which will probably affect the ability to install rdesktop-1.7.0 with smartcard enabled.


I will not upgrade to Lion until there is stable SmartCard support (from http://smartcardservices.macosforge.org) for Lion, so I do not have a Lion test-platform for rdesktop. I'm sorry.

Jan 10, 2012 11:03 AM in response to TRON

I am having similar issues; I upgraded to Lion to use Xcode 4, and I have successfully used the SmartCardServices Installer 2.0b1 package to access smart card protected services. Now I would like to use rdesktop, but 1.7 is not compiling (couldn't find the symbol--I think this error was seen before). I tried replacing with your function above, which got it to compile, but it hung after I put in a pin to log on remotely. I have also tried 1.6, but that gave the same result. Is there any chance that someone is working on rdesktop 1.7 on Lion with SmartCardServices? Thanks for any help!

rDesktop 1.7.0

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.