« VirusScan/Engine/Daemon/Trend/Trophie.pm
↑ Summary
VirusScan/Engine/Command/Authentium/CommandAntivirus.pm »
| 1 | package File::VirusScan::Engine::Command::CentralCommand::Vexira; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use File::VirusScan::Engine::Command; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use vars qw( @ISA ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | @ISA = qw( File::VirusScan::Engine::Command ); | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Cwd 'abs_path'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use File::VirusScan::Result; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub default_arguments | ||||||||||||||||||||||||||||
| 15 | 5 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
default_arguments: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 5 | return [qw(-qqq --log=/dev/null --all-files -as)]; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | sub scan | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
scan: not called CC=11 SCAR=48.8
Pod
documented
| |||||||||||||||||||||||||||||
| 21 | 0 | my ($self, $path) = @_; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | my $abs = abs_path($path); | |||||||||||||||||||||||||||
| 24 | 0 | ▶ | if ($abs && $abs ne $path) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$abs and $abs ne $path
MC/DC0%0/2
$abs and $abs ne $path
$abs
$abs ne $path
Truth table0%0/3
A and B
A= $absB= $abs ne $path
| |||||||||||||||||||||||||||||
| 25 | 0 | $path = $abs; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 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) /,); }; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if($@) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 0 | return File::VirusScan::Result->error($@); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if( 0 == $exitcode | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
0 == $exitcode or 9 == $exitcode
MC/DC0%0/2
0 == $exitcode or 9 == $exitcode
0 == $exitcode
9 == $exitcode
Truth table0%0/3
A or B
A= 0 == $exitcodeB= 9 == $exitcode
| |||||||||||||||||||||||||||||
| 35 | || 9 == $exitcode) | ||||||||||||||||||||||||||||
| 36 | { | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | # 0 == OK | ||||||||||||||||||||||||||||
| 39 | # 9 == Unknown file type (treated as "ok" for now) | ||||||||||||||||||||||||||||
| 40 | 0 | return File::VirusScan::Result->clean(); | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | if( 3 == $exitcode | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
3 == $exitcode or 5 == $exitcode
MC/DC0%0/2
3 == $exitcode or 5 == $exitcode
3 == $exitcode
5 == $exitcode
Truth table0%0/3
A or B
A= 3 == $exitcodeB= 5 == $exitcode
| |||||||||||||||||||||||||||||
| 44 | || 5 == $exitcode) | ||||||||||||||||||||||||||||
| 45 | { | ||||||||||||||||||||||||||||
| 46 | 0 | return File::VirusScan::Result->virus('vexira-password-protected-zip'); | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if( 1 == $exitcode | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
1 == $exitcode or 2 == $exitcode
MC/DC0%0/2
1 == $exitcode or 2 == $exitcode
1 == $exitcode
2 == $exitcode
Truth table0%0/3
A or B
A= 1 == $exitcodeB= 2 == $exitcode
| |||||||||||||||||||||||||||||
| 50 | || 2 == $exitcode) | ||||||||||||||||||||||||||||
| 51 | { | ||||||||||||||||||||||||||||
| 52 | 0 | my ($virus_name) = $scan_response =~ m/: (?:virus|iworm|macro|mutant|sequence|trojan) (\S+)/; | |||||||||||||||||||||||||||
| 53 | 0 | ▶ | $virus_name ||= 'unknown-Vexira-virus'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$virus_name ||= "unknown-Vexira-virus"
MC/DC0%0/1
$virus_name ||= "unknown-Vexira-virus"
$virus_name
Truth table0%0/2
A
A= $virus_name
| |||||||||||||||||||||||||||||
| 54 | 0 | return File::VirusScan::Result->virus($virus_name); | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | return File::VirusScan::Result->error("Unknown return code from vexira: $exitcode"); | |||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 1 | 1; | |||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||