#
# Symantec CarrierScan via Symantec CommandLineScanner
# TODO: avoid using CommandLineScanner by writing an own perl client
#

if ($cscmdline) {
    do_log(2, "Using $cscmdline");
    chop($output = `$cscmdline -a scan -i 1 -v -s $scs_host:$scs_port $TEMPDIR/parts`);
    do_log(2,$output);
    $scanner_errors = 0;
    if ($output =~ /\nInfected: /) {
        @virusname = ($output =~ /Info:\s+(.+)/g);
	do_virus();        
    } elsif ($output =~ /\n\*+ ERROR!/) {
        $scanner_errors &= 1;
        my @error_reason = ($output =~ /\n\*+ ERROR!\s+ (.+)/g);
	do_log(0, "Virus scanner failure: Symantec Carrier Scan - " . shift @error_reason); 
    }
}	
