« VirusScan/Engine/Command/FPROT/Fpscan.pm
↑ Summary
VirusScan/Engine/Command/Kaspersky/Kavscanner.pm »
| 1 | package File::VirusScan::Engine::Command::FSecure::FSAV; | ||||||||||||||||||||||||||||
| 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( --dumb --mime ) ]; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | sub scan | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
scan: not called CC=13 SCAR=52.0
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')); }; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if($@) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 0 | return File::VirusScan::Result->error($@); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if(0 == $exitcode) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | return File::VirusScan::Result->clean(); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | ▶ | if(1 == $exitcode) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | 0 | return File::VirusScan::Result->error('Abnormal termination'); | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if(2 == $exitcode) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | return File::VirusScan::Result->error('Self-test failed'); | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | ▶ | if(3 == $exitcode || 6 == $exitcode) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
3 == $exitcode or 6 == $exitcode
MC/DC0%0/2
3 == $exitcode or 6 == $exitcode
3 == $exitcode
6 == $exitcode
Truth table0%0/3
A or B
A= 3 == $exitcodeB= 6 == $exitcode
| |||||||||||||||||||||||||||||
| 47 | 0 | my ($virus_name) = $scan_response =~ m/infec.*\: (\S+)/i; | |||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if($virus_name eq '') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | 0 | $virus_name = 'unknown-FSAV-virus'; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | return File::VirusScan::Result->virus($virus_name); | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | ▶ | if(8 == $exitcode) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | # Suspicious files found | ||||||||||||||||||||||||||||
| 59 | 0 | return File::VirusScan::Result->virus('suspicious'); | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | ▶ | if(5 == $exitcode) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 63 | 0 | return File::VirusScan::Result->error('Scan interrupted'); | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if(7 == $exitcode) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | 0 | return File::VirusScan::Result->error('Out of memory'); | |||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 0 | return File::VirusScan::Result->error("Unknown return code from fsav: $exitcode"); | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 1 | 1; | |||||||||||||||||||||||||||
| 74 | __END__ | ||||||||||||||||||||||||||||