openct: libifd gone, scdl replaced with ltdl [u]

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

openct: libifd gone, scdl replaced with ltdl [u]

Andreas Jellinghaus-2
Hi,

first I made libifd an internal library.
it's only use is to use some code in two applications,
but there is no need for a shared library. there is
no public interface in libifd that we want to expose.

second, I replaced scdl with libtool ltdl library.
after reading the documentation several times, I
decided to use the INSTALLABLE approach - if libltdl
is present on the compiling system it will be used,
if not libltdl will be installed as shared library
and then used as such in openct.

because ltdl is only used in ifdhandler that way is
not mandatory, the other options would work fine,
but for opensc where we don't know if the some
application will use opensc and use libltdl itself,
it will be the best to work this way, too.

It compiles fine for me, further tests later.
but I guess nothing broke (and I don't know
any current user of the ld() interface anyway).

If anyone here is using the ability of openct
to load drivers from dynamic shared objects, please
let me know. Thanks.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Nils Larsch
Andreas Jellinghaus [c] wrote:

> Hi,
>
> first I made libifd an internal library.
> it's only use is to use some code in two applications,
> but there is no need for a shared library. there is
> no public interface in libifd that we want to expose.
>
> second, I replaced scdl with libtool ltdl library.
> after reading the documentation several times, I
> decided to use the INSTALLABLE approach - if libltdl
> is present on the compiling system it will be used,
> if not libltdl will be installed as shared library
> and then used as such in openct.

You mean openct installs the lib if it's not present ? I don't
really like the idea that we install a library we do not maintain:
assume we have a system without libltdl and want to install openct
install on it. As no libltdl is present openct will install libltdl.
Now assume that there's critical security flaw in libltdl. New versions
of openct will probably have a fixed version shipped with it,
however as there is a version of libltdl available now, openct will
use the old lib instead of the fixed one ... (and it can't be our
task to update libs we don't maintain).

Nils
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Andreas Jellinghaus-2
On Wednesday 24 August 2005 23:22, Nils Larsch wrote:
> You mean openct installs the lib if it's not present ? I don't
> really like the idea that we install a library we do not maintain:
> assume we have a system without libltdl and want to install openct
> install on it. As no libltdl is present openct will install libltdl.
> Now assume that there's critical security flaw in libltdl. New versions
> of openct will probably have a fixed version shipped with it,
> however as there is a version of libltdl available now, openct will
> use the old lib instead of the fixed one ... (and it can't be our
> task to update libs we don't maintain).

true. not a nice scenario. still, if we require that lib to be installed,
then installation will be more difficult. including the lib will prevent
that.

lets wait till we converted libp11, pam_p11, engine_pkc11 etc.
I guess we will have a better picture then how many modules we
have, how difficult it is to install all them - and wether they
should include libltdl if they use it or not. currently I'm not
certain which modules will end up requiring libltdl. if it is
many modules, it doesn't make much sence that each has a copy
of it in case it is not installed. if it is only one or two,
we can argue it makes installation easier.

also I need to check how easy it is to install libltdl (and nothing
else). not sure if there is a package for it (except as part of libtool).
modifications in the autoconf/automake/libtool chain are difficult, so
I think we should not need to ask people to install a new version of libtool.
but if not with libtool, where would people get libltdl, if it is not included
in our package?

oh well. world would be much easier, if there was one common libc that
everyone uses. the libtool/autoconf/automake/apr/glib zoo is crazy.

Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Ludovic Rousseau
On 25/08/05, Andreas Jellinghaus [c] <[hidden email]> wrote:
> lets wait till we converted libp11, pam_p11, engine_pkc11 etc.

libltdl is just one .c source file. So I do not see a space problem.
The problem is maintainence as Nils pointed out. In my version of
libp11 I used AC_LIBLTDL_CONVENIENCE to NOT install it but use it if
already installed.

> I guess we will have a better picture then how many modules we
> have, how difficult it is to install all them - and wether they
> should include libltdl if they use it or not. currently I'm not
> certain which modules will end up requiring libltdl. if it is
> many modules, it doesn't make much sence that each has a copy
> of it in case it is not installed. if it is only one or two,
> we can argue it makes installation easier.
>
> also I need to check how easy it is to install libltdl (and nothing
> else). not sure if there is a package for it (except as part of libtool).

Debian has it: libltdl3 and libltdl3-dev

> modifications in the autoconf/automake/libtool chain are difficult, so
> I think we should not need to ask people to install a new version of libtool.
> but if not with libtool, where would people get libltdl, if it is not included
> in our package?

I would _not_ like to have libp11, opensc or another software conflict
with libltdl3 because it tries to install libltdl.

Under Debian it is easy to require libltdl3-dev at compilation time so
that libltdl3 will be used. In case of a security bug in libltdl the
libltdl3 package is updated and every package using it is safe.

> oh well. world would be much easier, if there was one common libc that
> everyone uses. the libtool/autoconf/automake/apr/glib zoo is crazy.

And that common libc would be called Win32API ? :-)

Bye,

--
 Dr. Ludovic Rousseau
 For private mail use [hidden email] and not "big brother" Google
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Andreas Jellinghaus-2
On Thursday 25 August 2005 16:07, Ludovic Rousseau wrote:
> libltdl is just one .c source file. So I do not see a space problem.
> The problem is maintainence as Nils pointed out. In my version of
> libp11 I used AC_LIBLTDL_CONVENIENCE to NOT install it but use it if
> already installed.

that will link it into opensc, if you use that approach with opensc.
if some application uses libltdl itself and loads opensc we might
get symbol conflicts.

there are two ways to solve that:
 - use a shared library. that's why I'm using the _INSTALLABLE variant.
 - (not supported by libltdl as far as I know) prefix the functions
   with something, so the names of all functions are different, even
   if it is uses directly and/or indirectly several times in an application.

> > also I need to check how easy it is to install libltdl (and nothing
> > else). not sure if there is a package for it (except as part of libtool).
>
> Debian has it: libltdl3 and libltdl3-dev

yes, but I'm not sure of the rest. I have those "OperatingSystem" pages with
links to all distributions and the software they have available. I need to
check each on that list for libltdl3.

> I would _not_ like to have libp11, opensc or another software conflict
> with libltdl3 because it tries to install libltdl.

on debian the maintainer would simply add libltdl3-dev to the build
dependencies and then configure should use the existing libltdl and
leave the libltdl/ subdir unused. only if it is not installed, the
installable option will compile it and use it. right?

Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Ludovic Rousseau
On 25/08/05, Andreas Jellinghaus [c] <[hidden email]> wrote:

> On Thursday 25 August 2005 16:07, Ludovic Rousseau wrote:
> > libltdl is just one .c source file. So I do not see a space problem.
> > The problem is maintainence as Nils pointed out. In my version of
> > libp11 I used AC_LIBLTDL_CONVENIENCE to NOT install it but use it if
> > already installed.
>
> that will link it into opensc, if you use that approach with opensc.
> if some application uses libltdl itself and loads opensc we might
> get symbol conflicts.
>
> there are two ways to solve that:
>  - use a shared library. that's why I'm using the _INSTALLABLE variant.
>  - (not supported by libltdl as far as I know) prefix the functions
>    with something, so the names of all functions are different, even
>    if it is uses directly and/or indirectly several times in an application.

I don't know if we will find a perfect solution.
Since we are talking about libraries the libltdl should not be
exported to avoid conflicts. The symbols can either be internal only
(may not be portable) or not present at all and the code use an
external library.

The _INSTALLABLE variant may be the solution. Each OpenSC project has
it so users recompiling an OpenSC project will install libltdl the
first time. Distribution maintainers need to decide which OpenSC
project package provides libltdl or provide a libltdl in its own
package (like Debian does).

> > I would _not_ like to have libp11, opensc or another software conflict
> > with libltdl3 because it tries to install libltdl.
>
> on debian the maintainer would simply add libltdl3-dev to the build
> dependencies and then configure should use the existing libltdl and
> leave the libltdl/ subdir unused.

Yes.

> only if it is not installed, the
> installable option will compile it and use it. right?

And install it but the package maintainer still has to decide what to
include in the package.

Bye,

--
 Dr. Ludovic Rousseau
 For private mail use [hidden email] and not "big brother" Google
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Peter Stuge
In reply to this post by Nils Larsch
On Wed, Aug 24, 2005 at 11:22:32PM +0200, Nils Larsch wrote:

> Andreas Jellinghaus [c] wrote:
> >second, I replaced scdl with libtool ltdl library.
> >after reading the documentation several times, I
> >decided to use the INSTALLABLE approach - if libltdl
> >is present on the compiling system it will be used,
> >if not libltdl will be installed as shared library
> >and then used as such in openct.
>
> You mean openct installs the lib if it's not present ? I don't
> really like the idea that we install a library we do not maintain:

Doing that is WRONG<tm>, please don't do it. Distributors deal with
dependencies IMHO.


//Peter
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Andreas Jellinghaus-2
I thought libltdl was rather new and thus rare as package. I was wrong.
Finaly I checked the distributions and everybody has libltdl, most even
as a standalone package, mostly suse has it still as part of libtool.
(check rpmfind for a nice overview.)

I guess we can drop libltdl/ directory and depend on that package being
installed. Is that ok for everyone?

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Nils Larsch
In reply to this post by Ludovic Rousseau
Ludovic Rousseau wrote:
...
>> - use a shared library. that's why I'm using the _INSTALLABLE variant.

still don't like this alternative

>> - (not supported by libltdl as far as I know) prefix the functions
>>   with something, so the names of all functions are different, even
>>   if it is uses directly and/or indirectly several times in an application.

I think that is the only useful solution here (of course with
an appropriate #define in some internal header file, i.e. something
like:

#ifndef HAVE_LIBLTDL
#define lt_dlopen <nonce>_lt_dlopen
...
#endif

where the nonce is for example the md5 digest of configure.in
(should be sufficient for our purpose)).

Nils
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Peter Stuge
In reply to this post by Andreas Jellinghaus-2
On Sat, Aug 27, 2005 at 10:47:20AM +0200, Andreas Jellinghaus [c] wrote:
> I guess we can drop libltdl/ directory and depend on that package
> being installed. Is that ok for everyone?

Indeed OK with me! :)


//Peter
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct: libifd gone, scdl replaced with ltdl [u]

Ludovic Rousseau
On 27/08/05, Peter Stuge <[hidden email]> wrote:
> On Sat, Aug 27, 2005 at 10:47:20AM +0200, Andreas Jellinghaus [c] wrote:
> > I guess we can drop libltdl/ directory and depend on that package
> > being installed. Is that ok for everyone?
>
> Indeed OK with me! :)

Me too!

--
 Dr. Ludovic Rousseau
 For private mail use [hidden email] and not "big brother" Google
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel