line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::VirusScan::Engine::Command::Authentium::CommandAntivirus; |
2
|
1
|
|
|
1
|
|
45111
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
20
|
|
4
|
1
|
|
|
1
|
|
2
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
51
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
267
|
use File::VirusScan::Engine::Command; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
36
|
use vars qw( @ISA ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
8
|
|
|
|
|
|
|
@ISA = qw( File::VirusScan::Engine::Command ); |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
491
|
use IO::Socket::UNIX; |
|
1
|
|
|
|
|
9574
|
|
|
1
|
|
|
|
|
5
|
|
11
|
1
|
|
|
1
|
|
965
|
use IO::Select; |
|
1
|
|
|
|
|
1146
|
|
|
1
|
|
|
|
|
36
|
|
12
|
1
|
|
|
1
|
|
4
|
use Cwd 'abs_path'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
351
|
use File::VirusScan::Result; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
228
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub scan |
17
|
|
|
|
|
|
|
{ |
18
|
1
|
|
|
1
|
1
|
869
|
my ($self, $path) = @_; |
19
|
|
|
|
|
|
|
|
20
|
1
|
50
|
|
|
|
29
|
if(abs_path($path) ne $path) { |
21
|
1
|
|
|
|
|
14
|
return File::VirusScan::Result->error("Path $path is not absolute"); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my ($exitcode, $scan_response) = eval { $self->_run_commandline_scanner(join(' ', $self->{command}, @{ $self->{args} }, $path, '2>&1')); }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
if($@) { |
27
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error($@); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
if(50 == $exitcode) { |
31
|
0
|
|
|
|
|
|
return File::VirusScan::Result->clean(); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
if(5 == $exitcode) { |
35
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error('Scan interrupted'); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
if(101 == $exitcode) { |
39
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error('Out of memory'); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
if(52 == $exitcode) { |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# 52 == "suspicious" files |
45
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus('suspicious-CSAV-files'); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if(53 == $exitcode) { |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# Found and disinfected |
51
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus('unknown-CSAV-virus disinfected'); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
|
if(51 == $exitcode) { |
55
|
0
|
|
|
|
|
|
my ($virus_name) = $scan_response =~ m/infec.*\: (\S+)/i; |
56
|
0
|
0
|
|
|
|
|
if(!$virus_name) { |
57
|
0
|
|
|
|
|
|
$virus_name = 'unknown-CSAV-virus'; |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus($virus_name); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# Other codes, bail out. |
63
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error("Unknown return code from Command Antivirus: $exitcode"); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
__END__ |