line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OpenSSH::ShellQuoter; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
136751
|
use strict; |
|
7
|
|
|
|
|
30
|
|
|
7
|
|
|
|
|
205
|
|
4
|
7
|
|
|
7
|
|
36
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
191
|
|
5
|
7
|
|
|
7
|
|
30
|
use Carp; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
378
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
801
|
use Net::OpenSSH::ModuleLoader; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
2454
|
|
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
|
248601
|
my ($class, $shell) = @_; |
25
|
6
|
50
|
|
|
|
34
|
$shell = 'POSIX' unless defined $shell; |
26
|
6
|
50
|
|
|
|
34
|
return $shell if ref $shell; |
27
|
6
|
50
|
|
|
|
41
|
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
|
|
|
|
45
|
$shell = $alias{$shell} if defined $alias{$shell}; |
33
|
6
|
50
|
|
|
|
75
|
$shell =~ /^\w+$/ or croak "bad quoting style $shell"; |
34
|
6
|
|
|
|
|
22
|
my $impl = "Net::OpenSSH::ShellQuoter::$shell"; |
35
|
6
|
|
|
|
|
34
|
_load_module($impl); |
36
|
6
|
|
|
|
|
34
|
return $impl->new; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |