On 06/28/2011 12:32 AM, Paul Kraus wrote:
> 2011/6/27 Török Edwin <ed...@clamav.net>:
>> On 06/27/2011 11:37 PM, Paul Kraus wrote:
>>> 2011/6/27 Török Edwin <ed...@clamav.net>:
>>>
>>>> This will tell you the search path used by ClamAV to load unrar:
>>>> $ grep LT_DLSEARCH_PATH clamav-config.h
>>>
>>> Thanks for the pointer.
>>>
>>>> On my box it is:
>>>> /lib:/usr/lib:/usr/local/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib32:/usr/lib32
>>>
>>> On my system it is just:
>>>
>>> #define LT_DLSEARCH_PATH "/lib:/usr/lib"
>>>
>>> Is it supposed to be updated by ./configure ?
>>
>> Yes, it is generated by configure, is it wrong?
> 
> Well ... that is the default system (OS) library search path
> (/lib:/usr/lib), but the clamav libraries get installed in
> /usr/local/lib.
> 
>> But the actual search path used at runtime is just a subset of that, just 
>> $libdir (where libclamav.so is installed).
> 
> That's what I thought, but it does not appear to be looking there for
> the unrar libraries.
> 
>>> I know I can just go in
>>> and change it, but is there an automatic mechanism to update it ?
>>> Even though the check-log says that it is looking in the right place,
>>> it is really only looking at the locations specified here.
> 
> I tried adding /usr/local/lib to LT_DLSEARCH_PATH, but that had no
> (positive) effect.
> 
> more unit_tests/test-suite.log
> ==============================================
>    ClamAV 0.97.1: unit_tests/test-suite.log
> ==============================================
> 
> 2 of 7 tests failed.  (6 tests were not run).
> 
> .. contents:: :depth: 2
> 
> 
> SKIP: check_unit_vg.sh (exit: 77)
> =================================
> 
> *** valgrind tests skipped by default, use 'make check VG=1' to activate
> 
> FAIL: check1_clamscan.sh (exit: 42)
> ===================================
> 
> LibClamAV debug: searching for unrar, user-searchpath: /usr/local/lib
> LibClamAV debug: searching for unrar: libclamunrar_iface.so.6.1.10 not found
> LibClamAV debug: searching for unrar: libclamunrar_iface.so.6 not found
> LibClamAV debug: searching for unrar: libclamunrar_iface.so not found
> LibClamAV debug: searching for unrar: libclamunrar_iface.a not found
> LibClamAV Warning: Cannot dlopen libclamunrar_iface: file not found -
> unrar support unavailable
> LibClamAV debug: Initialized 0.97.1 engine
> ...
> ls -l /usr/local/lib/libclamunrar_iface*
> -rw-r--r--   1 root     root       29280 Jun 27 16:50
> /usr/local/lib/libclamunrar_iface.a
> -rwxr-xr-x   1 root     root         965 Jun 27 16:50
> /usr/local/lib/libclamunrar_iface.la
> 
> So the test log file appears to be lying ... it sys it is checking
> /usr/local/lib and can't find the unrar libraries, but they _are_
> there.

Only the .a file is, not the .so.

.a files cannot be dynamically loaded, they are just a bunch of .o files 
archived together.
I think on some systems .a files are dynamically linked too (AIX?), but 
certainly not on Solaris.
Only the .so can be dynamically loaded.

> 
> So it is finding it (/usr/local/lib/libclamunrar_iface.a), and opens
> it, and then writes to standard error (fd 2) that is couldn't find it
> and goes on.

Thats probably because dlopen() sees that the .a is not a shared object, and 
gives an error.
ClamAV just prints the error from libltdl, so libltdl probably cannot 
distinguish between
'file not found' and 'file found but not a shared object'.

> 
> The make tossed a couple warnings but no errors, could the unrar
> libraries be broken ?
> 

No, you just need to install the .so variant (i.e. build with --enable-shared).

Best regards,
--Edwin
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to