I think using the same technique as with libmusclecard would be safe.

As for the comment in the patch earlier... the problem is real and tested if
there are multiple linkages of libpcsclite, but one as a static lib and
another as shared lib (I remember dtlogin crashing.) It is safe if the
multiple linkages are all dynamic.

Regards,

Najam.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ludovic Rousseau
Sent: Friday, February 24, 2006 7:46 AM
To: MUSCLE
Subject: Re: [Muscle] SCardUnload() hidden(not exported) in beta 10.

On 23/02/06, Najam Siddiqui <[EMAIL PROTECTED]> wrote:
> SCardUnload() is hidden(not exported) in beta 10, I was wondering if there
> would be issues if libpcsclite.so is loaded using dlopen or say a pam
module
> links with libpcsclite.so and on login the pam module is loaded and
unloaded
> using dlopen/dlclose, effectively libpcsclite.so will also be unloaded
> without SCardUnload being called, would that result in leaks.
>
> Either we can add SCardUnload to functions to be called on unload using
the
> linker option -zfiniarray=SCardUnload or export SCardUnload.

SCardUnload is not part of winscard (Windows) API and then should not
be exported. The correct solution would be to automatically call this
function when the library is unload. I did not know the
-zfiniarray=foo option and could not find an "official" documentation
of it. Is it portable? Maybe a safer way to the use the same technique
used by musclecard_fini() in /libmusclecard/src/musclecard.c

Also note that calling this function may create problem as you noted
in a previous patch [1] (see the comment in the SCardUnload()
function). I don't know yet if this problem is real.

Which solution do you prefer?

Bye,

[1] http://lists.drizzle.com/pipermail/muscle/2005-October/004405.html

--
 Dr. Ludovic Rousseau

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to