Hi,

Attached is a patch to the currently release 1.24 version to allow it to work with CSAV for Linux/FreeBSD. It does better version detection, adds a required command-line switch and handles the return codes from the scanner better.

This patch is not, nor does it imply any official statement or support of qmail or qmail-scanner.

--  ---------------------------------------------------------------------
Robert Sandilands: Software Engineer
Disclaimer: http://robert.rsa3.com/disclaimer.html
Authentium: Home of Command Software
www.authentium.com


diff -u qmail-scanner-1.24/qmail-scanner-queue.template 
qmail-scanner-1.24.robert/qmail-scanner-queue.template
--- qmail-scanner-1.24/qmail-scanner-queue.template     Tue Oct 19 21:49:33 2004
+++ qmail-scanner-1.24.robert/qmail-scanner-queue.template      Tue Jan  4 
15:33:03 2005
@@ -1511,7 +1511,7 @@
       open(CS,"$csav_binary -virno|")||die "failed to call $csav_binary -virno 
- $!";
       while (<CS>) {
        chomp;
-       if (/Command Software AntiVirus for Linux (version [0-9\.]+)/) {
+       if (/Command Software AntiVirus for [a-zA-Z]* (version [0-9\.]+)/) {
          $SCANINFO .="csav: $1/";
        } elsif (/^CSA[V]: (.*)/) {
          $SCANINFO .= "$1/";
diff -u qmail-scanner-1.24/sub-csav.pl qmail-scanner-1.24.robert/sub-csav.pl
--- qmail-scanner-1.24/sub-csav.pl      Mon Apr 19 23:59:50 2004
+++ qmail-scanner-1.24.robert/sub-csav.pl       Tue Jan  4 15:30:31 2005
@@ -3,7 +3,7 @@
   &debug("csav_scanner: starting scan of directory \"$ENV{'TMPDIR'}\"...");
   my ($start_csav_time)=[gettimeofday];
   my 
($DD,$csav_status,$ecsav_status,$stop_csav_time,$csav_time,$csav_verbose,$csav_list);
-  my $options = "-nomem -packed -archive -noboot";
+  my $options = "-all -nomem -packed -archive -noboot";
   $csav_verbose="-silent" if (!$DEBUG);
   $csav_list="-list" if ($DEBUG);
 
@@ -14,7 +14,7 @@
   $csav_status=$?;
   $ecsav_status=($csav_status >> 8);
 
-  if ($DD =~ / Infection: (.*)/) {
+  if ( $ecsav_status > 50 && $ecsav_status < 54 ) {
     $quarantine_description=$1;
     &debug("There be a virus! ($quarantine_description)");
     ($quarantine_event=$quarantine_description)=~s/\s/_/g;

Reply via email to