Add clamd scans support
This commit is contained in:
parent
6033f2809f
commit
fe0bcfec3c
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
my $clam = $clamd{'status'} || 'disabled';
|
||||
return '' unless ($clam eq 'enabled');
|
||||
my $max = $clamav{StreamMaxLength} || '25M';
|
||||
my $limit = $max
|
||||
$limit =~ s/[KMG]$//;
|
||||
if ($max =~ m/G$/){
|
||||
$limit = $limit * 1024 * 1024 * 1024;
|
||||
}
|
||||
elsif ($max =~ m/M$/){
|
||||
$limit = $limit * 1024 * 1024;
|
||||
}
|
||||
elsif ($max =~ m/K$/){
|
||||
$limit = $limit * 1024;
|
||||
}
|
||||
# 1MB of margin to be sure we don't go over clamd limit
|
||||
$limit -= 1024 * 1024;
|
||||
$OUT .=<<"EOF";
|
||||
\$clamdScan = 'unix:///var/clamav/clamd.socket';
|
||||
\$scanMax = $limit;
|
||||
}
|
Loading…
Reference in New Issue