line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::VirusScan::Engine::Command::CentralCommand::Vexira; |
2
|
1
|
|
|
1
|
|
47171
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
3
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
260
|
use File::VirusScan::Engine::Command; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
7
|
1
|
|
|
1
|
|
36
|
use vars qw( @ISA ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
8
|
|
|
|
|
|
|
@ISA = qw( File::VirusScan::Engine::Command ); |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
3
|
use Cwd 'abs_path'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
290
|
use File::VirusScan::Result; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
219
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub default_arguments |
15
|
|
|
|
|
|
|
{ |
16
|
6
|
|
|
6
|
0
|
19
|
return [qw(-qqq --log=/dev/null --all-files -as)]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub scan |
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
1
|
1
|
558
|
my ($self, $path) = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
50
|
|
|
|
29
|
if(abs_path($path) ne $path) { |
24
|
1
|
|
|
|
|
10
|
return File::VirusScan::Result->error("Path $path is not absolute"); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my ($exitcode, $scan_response) = eval { $self->_run_commandline_scanner(join(' ', $self->{command}, @{ $self->{args} }, $path, '2>&1'), qr/: (?:virus|iworm|macro|mutant|sequence|trojan) /,); }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
if($@) { |
30
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error($@); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
0
|
|
|
|
if( 0 == $exitcode |
34
|
|
|
|
|
|
|
|| 9 == $exitcode) |
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# 0 == OK |
38
|
|
|
|
|
|
|
# 9 == Unknown file type (treated as "ok" for now) |
39
|
0
|
|
|
|
|
|
return File::VirusScan::Result->clean(); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
0
|
|
|
|
if( 3 == $exitcode |
43
|
|
|
|
|
|
|
|| 5 == $exitcode) |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus('vexira-password-protected-zip'); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
0
|
|
|
|
if( 1 == $exitcode |
49
|
|
|
|
|
|
|
|| 2 == $exitcode) |
50
|
|
|
|
|
|
|
{ |
51
|
0
|
|
|
|
|
|
my ($virus_name) = $scan_response =~ m/: (?:virus|iworm|macro|mutant|sequence|trojan) (\S+)/; |
52
|
0
|
|
0
|
|
|
|
$virus_name ||= 'unknown-Vexira-virus'; |
53
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus($virus_name); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error("Unknown return code from vexira: $exitcode"); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |