I saw the same post and checked this, but my conf file does not have multiple spaces before the socket file definition.

After studying the problem further it appears like this is a compatibility problem with ClamAV and the perl module IO::Socket::UNIX I was able to reproduce the problem using the following perl script which is a stripped version of the one mime-defang using to call on the clamd socket. This script works with 0.88 but not 0.88.1 I upgraded IO:Socket::Unix to version 1.23 but still no fix. Still working on it...

#!/usr/bin/perl -w

use IO::Socket::UNIX;
use strict;

my $socket = shift;
my $path = shift;

if (!defined $socket || !defined $path ) {
       print "Usage: testclam.pl socket_file directory\n";
       exit 0;
}

my $sock = IO::Socket::UNIX->new(Peer => $socket);
   if (defined $sock) {

       if (!$sock->print("SCAN $path\n")) {
           $sock->close;
           print "Failed with SCAN command.\n";
           exit 99;
       }
       if (!$sock->flush) {
           $sock->close;
           print "Failed to flush socket.\n";
           exit 99;
       }

       my($output, $ans);
       $ans = $sock->sysread($output,256);
       $sock->close;

       if (!defined($ans) || !$ans) {
           print "Did not recieve answer from SCAN call\n";
       }

       if ($output =~ /: (.+) FOUND/) {
           print "Found virus. Success.\n";
           exit 0;
       } elsif ($output =~ /: (.+) ERROR/) {
           my $err_detail = $1;
           print "SCAN resulted in error: $1\n";
           exit 99;
       }
       print "No virus found. Success.\n";
       exit 0;
   }

print "Could not connect to socket.\n";
exit 99;

--
Davin Flatten
Unix Systems Administrator
University of Massachusetts
Amherst, MA 01003

Phone: 413-545-1580
Email: [EMAIL PROTECTED]


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

Reply via email to