line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OpenSSH::ShellQuoter; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
112007
|
use strict; |
|
7
|
|
|
|
|
43
|
|
|
7
|
|
|
|
|
167
|
|
4
|
7
|
|
|
7
|
|
28
|
use warnings; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
128
|
|
5
|
7
|
|
|
7
|
|
27
|
use Carp; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
323
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
673
|
use Net::OpenSSH::ModuleLoader; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
1970
|
|
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
|
205909
|
my ($class, $shell) = @_; |
25
|
6
|
50
|
|
|
|
27
|
$shell = 'POSIX' unless defined $shell; |
26
|
6
|
50
|
|
|
|
24
|
return $shell if ref $shell; |
27
|
6
|
50
|
|
|
|
30
|
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
|
|
|
|
41
|
$shell = $alias{$shell} if defined $alias{$shell}; |
33
|
6
|
50
|
|
|
|
104
|
$shell =~ /^\w+$/ or croak "bad quoting style $shell"; |
34
|
6
|
|
|
|
|
21
|
my $impl = "Net::OpenSSH::ShellQuoter::$shell"; |
35
|
6
|
|
|
|
|
46
|
_load_module($impl); |
36
|
6
|
|
|
|
|
27
|
return $impl->new; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |