ClamAV binary needs .so from dev-package?

Rafael Ostertag raos at opencsw.org
Sun May 18 00:47:00 CEST 2014


Hi Peter

On Sat, May 17, 2014 at 11:05:02PM +0200, Peter Bonivart wrote:
> On Sat, May 17, 2014 at 10:11 PM, Rafael Ostertag <raos at opencsw.org> wrote:
> > dlopen() requires a pathname, so the usual 'SONAME is recorded in the binary,
> > and then used to locate the library later' does not apply here. AFAIK, all
> > applications which dlopen() libraries at runtime do so by searching for .so
> > files. As an example, apache's modules are loaded dynamically and also only
> > feature .so names (see /opt/csw/apache2/libexec). Using versioned file names
> > wouldn't do any good, and one had to constantly update the file name in the
> > code to keep in sync.
> 
> Good explanation, weird though that this happens now, I have built
> ClamAV for years and this is something new.

True. Ok, I believe I spotted the place where they compose the filename to
dlopen. It's in libclamav/others.c:lt_dlfind():

    static const char *suffixes[] = {
        LT_MODULE_EXT"."LIBCLAMAV_FULLVER,
        PASTE(LT_MODULE_EXT".", LIBCLAMAV_MAJORVER),
        LT_MODULE_EXT,
        "."LT_LIBEXT
    };

What says your clamav-config.h about LT_MODULE_EXT, LIBCLAMAV_FULLVER, etc.?

I tried it on Fedora 20. After removing the .so links, freshclam complained about

 LibClamAV Warning: Cannot dlopen libclamunrar_iface: file not found - unrar support unavailable

So, it might be a bug in the build system, since my clamav-config.h does

 #define LIBCLAMAV_FULLVER ".1.22"
 #define LIBCLAMAV_MAJORVER 
 #define LT_MODULE_EXT ".so"
 #define LT_LIBEXT "a"

which wouldn't form any suffix except for .so that leads to a resolvable filepath.

> 
> > However, if remotely possible, I would put the
> > dynamically loaded libraries into /opt/csw/lib/clamav or similar.
> 
> I think it would be easiest for me to just add a dep to the dev
> package for now and see if this is something they will continue with
> or not. If they do, I can go the apache2 way and include the .so links
> into the lib package.
> 
> Thanks for the help.

You're welcome.

cheers
rafi
> 


More information about the maintainers mailing list