line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# (c) Jan Gehring |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Rex::Helper::File::Stat::Win32; |
6
|
|
|
|
|
|
|
|
7
|
53
|
|
|
53
|
|
781
|
use v5.12.5; |
|
53
|
|
|
|
|
255
|
|
8
|
53
|
|
|
53
|
|
371
|
use warnings; |
|
53
|
|
|
|
|
183
|
|
|
53
|
|
|
|
|
2507
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.14.3'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
53
|
|
|
53
|
|
431
|
use Fcntl; |
|
53
|
|
|
|
|
182
|
|
|
53
|
|
|
|
|
13597
|
|
13
|
|
|
|
|
|
|
|
14
|
53
|
|
|
53
|
|
470
|
use Rex::Interface::Exec; |
|
53
|
|
|
|
|
176
|
|
|
53
|
|
|
|
|
571
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub S_ISDIR { |
17
|
0
|
|
|
0
|
0
|
|
shift; |
18
|
0
|
|
|
|
|
|
Fcntl::S_ISDIR(@_); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub S_ISREG { |
22
|
0
|
|
|
0
|
0
|
|
shift; |
23
|
0
|
|
|
|
|
|
Fcntl::S_ISREG(@_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub S_ISLNK { |
27
|
0
|
|
|
0
|
0
|
|
shift; |
28
|
0
|
0
|
|
|
|
|
if ( Rex::is_ssh() ) { |
29
|
0
|
|
|
|
|
|
my $exec = Rex::Interface::Exec->create; |
30
|
0
|
|
|
|
|
|
$exec->exec("perl -le 'use Fcntl; exit Fcntl::S_ISLNK($_[0])'"); |
31
|
0
|
|
|
|
|
|
return $?; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else { |
34
|
0
|
|
|
|
|
|
Rex::Logger::info( "S_ISLNK not supported on your platform.", "warn" ); |
35
|
0
|
|
|
|
|
|
return 0; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub S_ISBLK { |
40
|
0
|
|
|
0
|
0
|
|
shift; |
41
|
0
|
|
|
|
|
|
Fcntl::S_ISBLK(@_); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub S_ISCHR { |
45
|
0
|
|
|
0
|
0
|
|
shift; |
46
|
0
|
|
|
|
|
|
Fcntl::S_ISCHR(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub S_ISFIFO { |
50
|
0
|
|
|
0
|
0
|
|
shift; |
51
|
0
|
|
|
|
|
|
Fcntl::S_ISFIFO(@_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub S_ISSOCK { |
55
|
0
|
|
|
0
|
0
|
|
shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
if ( Rex::is_ssh() ) { |
58
|
0
|
|
|
|
|
|
my $exec = Rex::Interface::Exec->create; |
59
|
0
|
|
|
|
|
|
$exec->exec("perl -le 'use Fcntl; exit Fcntl::S_ISSOCK($_[0])'"); |
60
|
0
|
|
|
|
|
|
return $?; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
else { |
63
|
0
|
|
|
|
|
|
Rex::Logger::info( "S_ISSOCK not supported on your platform.", "warn" ); |
64
|
0
|
|
|
|
|
|
return 0; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub S_IMODE { |
69
|
0
|
|
|
0
|
0
|
|
shift; |
70
|
0
|
|
|
|
|
|
Fcntl::S_IMODE(@_); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |