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.

Here is my configure line:

  $ ./configure --disable-clamav --enable-check --disable-shared --enable-static

We are NOT running clamd (so we don't need the clamav user). the code
is just called as clamscan to scan individual files.

> Run clamscan --debug, and it'll tell you the exact searchpath and all the 
> files it tries (try removing libclamunrar_iface.so* and see all the files it 
> tries).

Same error...

$ truss -a -e -f -o truss.clamscan clamscan/clamscan --debug
>>clamscan.debug 2>>clamscan.debug
$ more clamscan.debug
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
...

>From the truss output (truss is a Solaris system call trace tool):

after looking for other varients of the unrar libraries like this...

29077:  access("/usr/local/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/usr/local/ssl/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/usr/local/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/usr/lib/libclamunrar_iface.so", R_OK)  Err#2 ENOENT
29077:  access("/usr/share/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/usr/sfw/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/usr/openwin/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/usr/dt/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/usr/X11R6/lib/libclamunrar_iface.so", R_OK) Err#2 ENOENT
29077:  access("/lib/libclamunrar_iface.so", R_OK)      Err#2 ENOENT
29077:  access("/usr/lib/libclamunrar_iface.so", R_OK)  Err#2 ENOENT
29077:  stat("/usr/local/ssl/lib/libclamunrar_iface.so", 0xFFBFCBF8)
Err#2 ENOENT
29077:  stat("/home/pkraus/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/local/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/share/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/sfw/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/openwin/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/dt/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/X11R6/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/local/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/usr/sfw/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  stat("/lib/libclamunrar_iface.so", 0xFFBFCBF8)  Err#2 ENOENT
29077:  stat("/usr/lib/libclamunrar_iface.so", 0xFFBFCBF8) Err#2 ENOENT
29077:  write(2, " L i b C l a m A V   d e".., 70)      = 70

^^^^ The above is the "LibClamAV debug: searching for unrar:
libclamunrar_iface.so not found" line

29077:  access("/usr/local/lib/libclamunrar_iface.a", R_OK) = 0
29077:  stat("/usr/local/lib/libclamunrar_iface.a", 0xFFBFCB00) = 0
29077:  resolvepath("/usr/local/lib/libclamunrar_iface.a",
"/usr/local/lib/libclamunrar_iface.a", 1023) = 35
29077:  open("/usr/local/lib/libclamunrar_iface.a", O_RDONLY) = 3
29077:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF310000
29077:  close(3)                                        = 0
29077:  munmap(0xFF310000, 32768)                       = 0
29077:  write(2, " L i b C l a m A V   d e".., 69)      = 69

^^^^ The above is the "LibClamAV debug: searching for unrar:
libclamunrar_iface.a not found" line

29077:  write(2, " L i b C l a m A V   W a".., 96)      = 96

^^^^ The above is the "LibClamAV Warning: Cannot dlopen
libclamunrar_iface: file not found - unrar support unavailable" line

29077:  times(0xFFBFD2F8)                               = 1921262851
29077:  sysconfig(_CONFIG_CLK_TCK)                      = 100
29077:  sysconfig(_CONFIG_PAGESIZE)                     = 8192
29077:  mmap(0x00000000, 262144, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEE30000
29077:  write(2, " L i b C l a m A V   d e".., 43)      = 43

^^^^ The above is the "LibClamAV debug: Initialized 0.97.1 engine" line

29077:  brk(0x00159018)                                 = 0
29077:  brk(0x0015B018)                                 = 0
29077:  open("/usr/local/etc/freshclam.conf", O_RDONLY) = 3

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.

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

-- 
{--------1---------2---------3---------4---------5---------6---------7---------}
Paul Kraus
-> Senior Systems Architect, Garnet River ( http://www.garnetriver.com/ )
-> Sound Coordinator, Schenectady Light Opera Company (
http://www.sloctheater.org/ )
-> Technical Advisor, RPI Players
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to