| 1 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | package Rex::Interface::Connection::Local; | ||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 69 | ▶ | use v5.14.4; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 69 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 69 | our $VERSION = '1.16.1'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 69 | ▶ | use Rex::Interface::Connection::Base; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 69 | ▶ | use Rex::Group::Entry::Server; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 69 | ▶ | use base qw(Rex::Interface::Connection::Base); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 103 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 103 | my $that = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | 103 | ▶ | my $proto = ref($that) || $that; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $that || $that
MC/DC0%0/2
ref $that || $that
ref $that
$that
Truth table33%1/3
A || B
A= ref $thatB= $that
| |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 103 | my $self = $that->SUPER::new(@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 103 | $self->{server} = Rex::Group::Entry::Server->new( name => "<local>" ); | |||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 103 | bless( $self, $proto ); | |||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 103 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub error { } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 34 | ▶ | sub connect { } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
connect: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 27 | ▶ | sub disconnect { } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
disconnect: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 214 | ▶ | sub get_connection_object { my ($self) = @_; return $self; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_connection_object: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub get_fs_connection_object { my ($self) = @_; return $self; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_fs_connection_object: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 34 | ▶ | sub is_connected { return 1; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_connected: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 34 | ▶ | sub is_authenticated { return 1; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_authenticated: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub get_auth_user { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_auth_user: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | return Rex::Config::get_user(); | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 3721 | ▶ | sub get_connection_type { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_connection_type: called CC=4 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 3721 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 3721 | ▶ | if ( ( $self->{is_sudo} && $self->{is_sudo} == 1 ) || Rex::is_sudo() ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"is_sudo"} and $self->{"is_sudo"} == 1 or Rex::is_sudo()
$self->{"is_sudo"} and $self->{"is_sudo"} == 1
MC/DC0%0/3
$self->{"is_sudo"} and $self->{"is_sudo"} == 1 or Rex::is_sudo()
$self->{"is_sudo"}
$self->{"is_sudo"} == 1
Rex::is_sudo()
Truth table20%1/5
A and B or C
A= $self->{"is_sudo"}B= $self->{"is_sudo"} == 1C= Rex::is_sudo()
| |||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | return "Sudo"; | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 3721 | return "Local"; | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 69 | 1; | |||||||||||||||||||||||||||||||||||||||||||||