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