#
# KasperskyLab AVP
#

if ($avp) {
    do_log(2,"Using $avp");
    chdir($AVPDIR) or die "Can't chdir to $AVPDIR: $!";
    chop($output = `$avp -* -P -B -Y -O- $TEMPDIR/parts`);
    $errval = retcode($?);
    chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!";
    do_log(2,$output);
    if ($errval == 0) {				# no errors, no viruses found
	$scanner_errors = 0;
    } elsif ($errval == 3 || $errval == 4) {	# no errors, viruses discovered
	$scanner_errors = 0;
	@virusname = ($output =~ /infected: (.+)/g);
	@virusname = (undef)  if !@virusname;	# just in case: make list nonnil
	do_virus();
    } else {
	do_log(0,"Virus scanner failure: $avp (error code: $errval)");
    }
}
