| 1 | package File::VirusScan::Engine::Command::Kaspersky::Kavscanner; | ||||||||||||||||||||||||||||||||||||||||||
| 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( -e PASBME -o syslog -i0 ) ]; | |||||||||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | sub scan | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
scan: not called CC=12 SCAR=50.5
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'), 'INFECTED',); }; | |||||||||||||||||||||||||||||||||||||||||
| 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/6
0 == $exitcode or 5 == $exitcode or 10 == $exitcode
0 == $exitcode or 5 == $exitcode
MC/DC0%0/3
0 == $exitcode or 5 == $exitcode or 10 == $exitcode
0 == $exitcode
5 == $exitcode
10 == $exitcode
Truth table0%0/4
A or B or C
A= 0 == $exitcodeB= 5 == $exitcodeC= 10 == $exitcode
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | || 5 == $exitcode | ||||||||||||||||||||||||||||||||||||||||||
| 36 | || 10 == $exitcode) | ||||||||||||||||||||||||||||||||||||||||||
| 37 | { | ||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | return File::VirusScan::Result->clean(); | |||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if(9 == $exitcode) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | # Password-protected ZIP | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | return File::VirusScan::Result->virus('kavscanner-password-protected-zip'); | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | if(20 == $exitcode) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | return File::VirusScan::Result->virus('kavscanner-suspicious'); | |||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if( 21 == $exitcode | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
21 == $exitcode or 25 == $exitcode
MC/DC0%0/2
21 == $exitcode or 25 == $exitcode
21 == $exitcode
25 == $exitcode
Truth table0%0/3
A or B
A= 21 == $exitcodeB= 25 == $exitcode
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | || 25 == $exitcode) | ||||||||||||||||||||||||||||||||||||||||||
| 53 | { | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | my ($virus_name) = $scan_response =~ m/INFECTED (\S+)/; | |||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | $virus_name ||= 'unknown-Kavscanner-virus'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$virus_name ||= "unknown-Kavscanner-virus"
MC/DC0%0/1
$virus_name ||= "unknown-Kavscanner-virus"
$virus_name
Truth table0%0/2
A
A= $virus_name
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | return File::VirusScan::Result->virus($virus_name); | |||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | return File::VirusScan::Result->error("Unknown return code: $exitcode"); | |||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 63 | __END__ | ||||||||||||||||||||||||||||||||||||||||||