[Clamav-users] RAR module failure even with external unrar

2005-03-22 Thread Alexander Lelyakin
I have just encountered a problem:
clamscan --unrar
works good only if archive has extension .rar
This behavior was found on Debian sarge and on SUSE9.0:
here follows some example:
$ clamscan --unrar clam-error.rar
/home/lel/tmp/clam-error.rar: RAR module failure
UNRAR 3.30 freeware  Copyright (c) 1993-2004 Eugene Roshal
Extracting from /home/lel/tmp/clam-error.rar
Extracting  clam.exe  OK
All OK
/tmp/clamav-ff80a84a8d55f11d/clam.exe: ClamAV-Test-File FOUND
/home/lel/tmp/clam-error.rar: Infected Archive FOUND
--- SCAN SUMMARY ---
Known viruses: 31812
Scanned directories: 1
Scanned files: 2
Infected files: 1
Data scanned: 0.00 MB
I/O buffer size: 131072 bytes
Time: 0.749 sec (0 m 0 s)
Everything OK sofar.
Let's rename file:
$ mv clam-error.rar 999
What we can get now:
$ clamscan --unrar 999
/home/lel/tmp/999: RAR module failure
--- SCAN SUMMARY ---
Known viruses: 31812
Scanned directories: 0
Scanned files: 1
Infected files: 0
Data scanned: 0.00 MB
I/O buffer size: 131072 bytes
Time: 0.764 sec (0 m 0 s)
___
http://lurker.clamav.net/list/clamav-users.html


[Clamav-users] Re: RAR module failure even with external unrar

2005-03-22 Thread Alexander Lelyakin
Alexander Lelyakin wrote:
I have just encountered a problem:
clamscan --unrar
works good only if archive has extension .rar
Following command:
$ cat clam-error.rar | clamscan --unrar -
also does not catch viruses
___
http://lurker.clamav.net/list/clamav-users.html


[Clamav-users] Re: RAR module failure even with external unrar

2005-03-22 Thread Alexander Lelyakin
Pierluigi Di Lorenzo wrote:
Following command:
$ cat clam-error.rar | clamscan --unrar -
try:
$cat clam-error.rar | xargs clamscan --unrar
And have You tried it yourself?
Probably You mean:
echo clam-error.rar | xargs clamscan --unrar
But the problem is that clamscan cannot check rar archives from stdin,
without first saving them to file (with .rar extension)
For checking a rar file that has no .rar extension I have
some very simple workaround that works for me (shell script):
#!/bin/bash
case `file $1` in
  *RAR*)
   $tmp=tmp$$.rar
   ln -s $1 $1
   file=$tmp;;
  *)
   file=$1;;
esac
clamscan --unrar $file
if [[ -n $tmp ]]; then
  rm $tmp
fi

___
http://lurker.clamav.net/list/clamav-users.html