line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OpenSSH::ShellQuoter; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
119682
|
use strict; |
|
7
|
|
|
|
|
31
|
|
|
7
|
|
|
|
|
178
|
|
4
|
7
|
|
|
7
|
|
27
|
use warnings; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
137
|
|
5
|
7
|
|
|
7
|
|
26
|
use Carp; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
388
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
669
|
use Net::OpenSSH::ModuleLoader; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
2134
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %alias = (bash => 'POSIX', |
10
|
|
|
|
|
|
|
sh => 'POSIX', |
11
|
|
|
|
|
|
|
ksh => 'POSIX', |
12
|
|
|
|
|
|
|
ash => 'POSIX', |
13
|
|
|
|
|
|
|
dash => 'POSIX', |
14
|
|
|
|
|
|
|
pdksh => 'POSIX', |
15
|
|
|
|
|
|
|
mksh => 'POSIX', |
16
|
|
|
|
|
|
|
lksh => 'POSIX', |
17
|
|
|
|
|
|
|
zsh => 'POSIX', |
18
|
|
|
|
|
|
|
fizsh => 'POSIX', |
19
|
|
|
|
|
|
|
posh => 'POSIX', |
20
|
|
|
|
|
|
|
fish => 'fish', |
21
|
|
|
|
|
|
|
tcsh => 'csh'); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub quoter { |
24
|
6
|
|
|
6
|
0
|
212033
|
my ($class, $shell) = @_; |
25
|
6
|
50
|
|
|
|
33
|
$shell = 'POSIX' unless defined $shell; |
26
|
6
|
50
|
|
|
|
21
|
return $shell if ref $shell; |
27
|
6
|
50
|
|
|
|
32
|
if ($shell =~ /,/) { |
28
|
0
|
|
|
|
|
0
|
require Net::OpenSSH::ShellQuoter::Chain; |
29
|
0
|
|
|
|
|
0
|
return Net::OpenSSH::ShellQuoter::Chain->chain(split /\s*,\s*/, $shell); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
else { |
32
|
6
|
100
|
|
|
|
30
|
$shell = $alias{$shell} if defined $alias{$shell}; |
33
|
6
|
50
|
|
|
|
49
|
$shell =~ /^\w+$/ or croak "bad quoting style $shell"; |
34
|
6
|
|
|
|
|
21
|
my $impl = "Net::OpenSSH::ShellQuoter::$shell"; |
35
|
6
|
|
|
|
|
40
|
_load_module($impl); |
36
|
6
|
|
|
|
|
108
|
return $impl->new; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |