| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package File::chmod; |
|
2
|
6
|
|
|
6
|
|
250940
|
use strict; |
|
|
6
|
|
|
|
|
13
|
|
|
|
6
|
|
|
|
|
212
|
|
|
3
|
6
|
|
|
6
|
|
26
|
use warnings; |
|
|
6
|
|
|
|
|
9
|
|
|
|
6
|
|
|
|
|
162
|
|
|
4
|
6
|
|
|
6
|
|
25
|
use Carp; |
|
|
6
|
|
|
|
|
8
|
|
|
|
6
|
|
|
|
|
382
|
|
|
5
|
6
|
|
|
6
|
|
27
|
use vars qw( $VAL $W $MODE ); |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
353
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
28
|
use base 'Exporter'; |
|
|
6
|
|
|
|
|
16
|
|
|
|
6
|
|
|
|
|
15294
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.42'; # VERSION |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = (qw( chmod getchmod )); ## no critic ( ProhibitAutomaticExportation ) |
|
12
|
|
|
|
|
|
|
our @EXPORT_OK = (qw( symchmod lschmod getsymchmod getlschmod getmod )); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $DEBUG = 1; |
|
15
|
|
|
|
|
|
|
our $UMASK = 2; |
|
16
|
|
|
|
|
|
|
our $MASK = umask; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my ($SYM,$LS) = (1,2); |
|
20
|
|
|
|
|
|
|
my %ERROR = ( |
|
21
|
|
|
|
|
|
|
EDETMOD => "use of determine_mode is deprecated", |
|
22
|
|
|
|
|
|
|
ENEXLOC => "cannot set group execute on locked file", |
|
23
|
|
|
|
|
|
|
ENLOCEX => "cannot set file locking on group executable file", |
|
24
|
|
|
|
|
|
|
ENSGLOC => "cannot set-gid on locked file", |
|
25
|
|
|
|
|
|
|
ENLOCSG => "cannot set file locking on set-gid file", |
|
26
|
|
|
|
|
|
|
ENEXUID => "execute bit must be on for set-uid", |
|
27
|
|
|
|
|
|
|
ENEXGID => "execute bit must be on for set-gid", |
|
28
|
|
|
|
|
|
|
ENULSID => "set-id has no effect for 'others'", |
|
29
|
|
|
|
|
|
|
ENULSBG => "sticky bit has no effect for 'group'", |
|
30
|
|
|
|
|
|
|
ENULSBU => "sticky bit has no effect for 'user'", |
|
31
|
|
|
|
|
|
|
); |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub getmod { |
|
34
|
34
|
|
|
34
|
1
|
1349
|
my @return = map { (stat)[2] & 07777 } @_; |
|
|
34
|
|
|
|
|
683
|
|
|
35
|
34
|
100
|
|
|
|
242
|
return wantarray ? @return : $return[0]; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub chmod (@) { ## no critic ( Subroutines::ProhibitBuiltinHomonyms Subroutines::ProhibitSubroutinePrototypes ) |
|
40
|
21
|
|
|
21
|
1
|
2076
|
my $mode = shift; |
|
41
|
21
|
|
|
|
|
49
|
my $how = mode($mode); |
|
42
|
|
|
|
|
|
|
|
|
43
|
21
|
100
|
|
|
|
73
|
return symchmod($mode,@_) if $how == $SYM; |
|
44
|
3
|
50
|
|
|
|
14
|
return lschmod($mode,@_) if $how == $LS; |
|
45
|
3
|
|
|
|
|
56
|
return CORE::chmod($mode,@_); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub getchmod { |
|
50
|
0
|
|
|
0
|
1
|
0
|
my $mode = shift; |
|
51
|
0
|
|
|
|
|
0
|
my $how = mode($mode); |
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
0
|
return getsymchmod($mode,@_) if $how == $SYM; |
|
54
|
0
|
0
|
|
|
|
0
|
return getlschmod($mode,@_) if $how == $LS; |
|
55
|
0
|
0
|
|
|
|
0
|
return wantarray ? (($mode) x @_) : $mode; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub symchmod { |
|
60
|
18
|
|
|
18
|
1
|
26
|
my $mode = shift; |
|
61
|
|
|
|
|
|
|
|
|
62
|
18
|
50
|
|
|
|
42
|
warnings::warnif 'deprecated', '$UMASK being true is deprecated' |
|
63
|
|
|
|
|
|
|
. ' it will be false by default in the future. This change' |
|
64
|
|
|
|
|
|
|
. ' is being made because this not the behavior of the unix command' |
|
65
|
|
|
|
|
|
|
. ' `chmod`. This warning can be disabled by putting explicitly' |
|
66
|
|
|
|
|
|
|
. ' setting $File::chmod::UMASK to false (0) to act like system chmod,' |
|
67
|
|
|
|
|
|
|
. ' or any non 2 true value see Github issue #5 ' |
|
68
|
|
|
|
|
|
|
if $UMASK == 2; |
|
69
|
|
|
|
|
|
|
|
|
70
|
18
|
|
|
|
|
45
|
my @return = getsymchmod($mode,@_); |
|
71
|
18
|
|
|
|
|
22
|
my $ret = 0; |
|
72
|
18
|
50
|
|
|
|
36
|
for (@_){ $ret++ if CORE::chmod(shift(@return),$_) } |
|
|
18
|
|
|
|
|
459
|
|
|
73
|
18
|
|
|
|
|
135
|
return $ret; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub getsymchmod { |
|
78
|
18
|
|
|
18
|
1
|
22
|
my $mode = shift; |
|
79
|
18
|
|
|
|
|
17
|
my @return; |
|
80
|
|
|
|
|
|
|
|
|
81
|
18
|
50
|
|
|
|
30
|
croak "symchmod received non-symbolic mode: $mode" if mode($mode) != $SYM; |
|
82
|
|
|
|
|
|
|
|
|
83
|
18
|
|
|
|
|
37
|
for (@_){ |
|
84
|
18
|
|
|
|
|
34
|
local $VAL = getmod($_); |
|
85
|
|
|
|
|
|
|
|
|
86
|
18
|
|
|
|
|
69
|
for my $this (split /,/, $mode){ |
|
87
|
18
|
|
|
|
|
22
|
local $W = 0; |
|
88
|
18
|
|
|
|
|
15
|
my $or; |
|
89
|
|
|
|
|
|
|
|
|
90
|
18
|
|
|
|
|
42
|
for (split //, $this){ |
|
91
|
52
|
100
|
100
|
|
|
207
|
if (not defined $or and /[augo]/){ |
|
92
|
16
|
50
|
|
|
|
38
|
/a/ and $W |= 7, next; |
|
93
|
16
|
100
|
|
|
|
47
|
/u/ and $W |= 1, next; |
|
94
|
9
|
100
|
|
|
|
26
|
/g/ and $W |= 2, next; |
|
95
|
5
|
50
|
|
|
|
21
|
/o/ and $W |= 4, next; |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
36
|
100
|
|
|
|
106
|
if (/[-+=]/){ |
|
99
|
18
|
|
100
|
|
|
60
|
$W ||= 7; |
|
100
|
18
|
100
|
|
|
|
69
|
$or = (/[=+]/ ? 1 : 0); |
|
101
|
18
|
50
|
|
|
|
46
|
clear() if /=/; |
|
102
|
18
|
|
|
|
|
24
|
next; |
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
|
|
105
|
18
|
50
|
|
|
|
51
|
croak "Bad mode $this" if not defined $or; |
|
106
|
18
|
50
|
|
|
|
47
|
croak "Unknown mode: $mode" if !/[ugorwxslt]/; |
|
107
|
|
|
|
|
|
|
|
|
108
|
18
|
0
|
|
|
|
40
|
/u/ and $or ? u_or() : u_not(); |
|
|
|
50
|
|
|
|
|
|
|
109
|
18
|
0
|
|
|
|
41
|
/g/ and $or ? g_or() : g_not(); |
|
|
|
50
|
|
|
|
|
|
|
110
|
18
|
0
|
|
|
|
68
|
/o/ and $or ? o_or() : o_not(); |
|
|
|
50
|
|
|
|
|
|
|
111
|
18
|
100
|
|
|
|
64
|
/r/ and $or ? r_or() : r_not(); |
|
|
|
100
|
|
|
|
|
|
|
112
|
18
|
100
|
|
|
|
78
|
/w/ and $or ? w_or() : w_not(); |
|
|
|
100
|
|
|
|
|
|
|
113
|
18
|
100
|
|
|
|
46
|
/x/ and $or ? x_or() : x_not(); |
|
|
|
100
|
|
|
|
|
|
|
114
|
18
|
0
|
|
|
|
36
|
/s/ and $or ? s_or() : s_not(); |
|
|
|
50
|
|
|
|
|
|
|
115
|
18
|
0
|
|
|
|
36
|
/l/ and $or ? l_or() : l_not(); |
|
|
|
50
|
|
|
|
|
|
|
116
|
18
|
100
|
|
|
|
80
|
/t/ and $or ? t_or() : t_not(); |
|
|
|
100
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
} |
|
119
|
18
|
50
|
|
|
|
34
|
$VAL &= ~$MASK if $UMASK; |
|
120
|
18
|
|
|
|
|
36
|
push @return, $VAL; |
|
121
|
|
|
|
|
|
|
} |
|
122
|
18
|
50
|
|
|
|
57
|
return wantarray ? @return : $return[0]; |
|
123
|
|
|
|
|
|
|
} |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub lschmod { |
|
127
|
0
|
|
|
0
|
1
|
0
|
my $mode = shift; |
|
128
|
|
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
0
|
return CORE::chmod(getlschmod($mode,@_),@_); |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub getlschmod { |
|
134
|
0
|
|
|
0
|
1
|
0
|
my $mode = shift; |
|
135
|
0
|
|
|
|
|
0
|
my $VAL = 0; |
|
136
|
|
|
|
|
|
|
|
|
137
|
0
|
0
|
|
|
|
0
|
croak "lschmod received non-ls mode: $mode" if mode($mode) != $LS; |
|
138
|
|
|
|
|
|
|
|
|
139
|
0
|
|
|
|
|
0
|
my ($u,$g,$o) = ($mode =~ /^.(...)(...)(...)$/); |
|
140
|
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
0
|
for ($u){ |
|
142
|
0
|
0
|
|
|
|
0
|
$VAL |= 0400 if /r/; |
|
143
|
0
|
0
|
|
|
|
0
|
$VAL |= 0200 if /w/; |
|
144
|
0
|
0
|
|
|
|
0
|
$VAL |= 0100 if /[xs]/; |
|
145
|
0
|
0
|
|
|
|
0
|
$VAL |= 04000 if /[sS]/; |
|
146
|
|
|
|
|
|
|
} |
|
147
|
|
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
0
|
for ($g){ |
|
149
|
0
|
0
|
|
|
|
0
|
$VAL |= 0040 if /r/; |
|
150
|
0
|
0
|
|
|
|
0
|
$VAL |= 0020 if /w/; |
|
151
|
0
|
0
|
|
|
|
0
|
$VAL |= 0010 if /[xs]/; |
|
152
|
0
|
0
|
|
|
|
0
|
$VAL |= 02000 if /[sS]/; |
|
153
|
|
|
|
|
|
|
} |
|
154
|
|
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
0
|
for ($o){ |
|
156
|
0
|
0
|
|
|
|
0
|
$VAL |= 0004 if /r/; |
|
157
|
0
|
0
|
|
|
|
0
|
$VAL |= 0002 if /w/; |
|
158
|
0
|
0
|
|
|
|
0
|
$VAL |= 0001 if /[xt]/; |
|
159
|
0
|
0
|
|
|
|
0
|
$VAL |= 01000 if /[Tt]/; |
|
160
|
|
|
|
|
|
|
} |
|
161
|
|
|
|
|
|
|
|
|
162
|
0
|
0
|
|
|
|
0
|
return wantarray ? (($VAL) x @_) : $VAL; |
|
163
|
|
|
|
|
|
|
} |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub mode { |
|
167
|
39
|
|
|
39
|
0
|
62
|
my $mode = shift; |
|
168
|
39
|
100
|
|
|
|
145
|
return 0 if $mode !~ /\D/; |
|
169
|
36
|
100
|
|
|
|
127
|
return $SYM if $mode =~ /[augo=+,]/; |
|
170
|
8
|
50
|
|
|
|
18
|
return $LS if $mode =~ /^.([r-][w-][xSs-]){2}[r-][w-][xTt-]$/; |
|
171
|
8
|
|
|
|
|
17
|
return $SYM; |
|
172
|
|
|
|
|
|
|
} |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
sub determine_mode { |
|
176
|
0
|
|
|
0
|
0
|
0
|
carp $ERROR{EDECMOD}; |
|
177
|
0
|
|
|
|
|
0
|
mode(@_); |
|
178
|
|
|
|
|
|
|
} |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub clear { |
|
182
|
0
|
0
|
|
0
|
0
|
0
|
$W & 1 and $VAL &= 02077; |
|
183
|
0
|
0
|
|
|
|
0
|
$W & 2 and $VAL &= 05707; |
|
184
|
0
|
0
|
|
|
|
0
|
$W & 4 and $VAL &= 07770; |
|
185
|
|
|
|
|
|
|
} |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub u_or { |
|
189
|
0
|
|
|
0
|
0
|
0
|
my $val = $VAL; |
|
190
|
0
|
0
|
|
|
|
0
|
$W & 2 and ($VAL |= (($val & 0700)>>3 | ($val & 04000)>>1)); |
|
191
|
0
|
0
|
|
|
|
0
|
$W & 4 and ($VAL |= (($val & 0700)>>6)); |
|
192
|
|
|
|
|
|
|
} |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
sub u_not { |
|
196
|
0
|
|
|
0
|
0
|
0
|
my $val = $VAL; |
|
197
|
0
|
0
|
|
|
|
0
|
$W & 1 and $VAL &= ~(($val & 0700) | ($val & 05000)); |
|
198
|
0
|
0
|
|
|
|
0
|
$W & 2 and $VAL &= ~(($val & 0700)>>3 | ($val & 04000)>>1); |
|
199
|
0
|
0
|
|
|
|
0
|
$W & 4 and $VAL &= ~(($val & 0700)>>6); |
|
200
|
|
|
|
|
|
|
} |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
sub g_or { |
|
204
|
0
|
|
|
0
|
0
|
0
|
my $val = $VAL; |
|
205
|
0
|
0
|
|
|
|
0
|
$W & 1 and $VAL |= (($val & 070)<<3 | ($val & 02000)<<1); |
|
206
|
0
|
0
|
|
|
|
0
|
$W & 4 and $VAL |= ($val & 070)>>3; |
|
207
|
|
|
|
|
|
|
} |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub g_not { |
|
211
|
0
|
|
|
0
|
0
|
0
|
my $val = $VAL; |
|
212
|
0
|
0
|
|
|
|
0
|
$W & 1 and $VAL &= ~(($val & 070)<<3 | ($val & 02000)<<1); |
|
213
|
0
|
0
|
|
|
|
0
|
$W & 2 and $VAL &= ~(($val & 070) | ($val & 02000)); |
|
214
|
0
|
0
|
|
|
|
0
|
$W & 4 and $VAL &= ~(($val & 070)>>3); |
|
215
|
|
|
|
|
|
|
} |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
sub o_or { |
|
219
|
0
|
|
|
0
|
0
|
0
|
my $val = $VAL; |
|
220
|
0
|
0
|
|
|
|
0
|
$W & 1 and $VAL |= (($val & 07)<<6); |
|
221
|
0
|
0
|
|
|
|
0
|
$W & 2 and $VAL |= (($val & 07)<<3); |
|
222
|
|
|
|
|
|
|
} |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
sub o_not { |
|
226
|
0
|
|
|
0
|
0
|
0
|
my $val = $VAL; |
|
227
|
0
|
0
|
|
|
|
0
|
$W & 1 and $VAL &= ~(($val & 07)<<6); |
|
228
|
0
|
0
|
|
|
|
0
|
$W & 2 and $VAL &= ~(($val & 07)<<3); |
|
229
|
0
|
0
|
|
|
|
0
|
$W & 4 and $VAL &= ~($val & 07); |
|
230
|
|
|
|
|
|
|
} |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub r_or { |
|
234
|
4
|
50
|
|
4
|
0
|
12
|
$W & 1 and $VAL |= 0400; |
|
235
|
4
|
100
|
|
|
|
11
|
$W & 2 and $VAL |= 0040; |
|
236
|
4
|
100
|
|
|
|
11
|
$W & 4 and $VAL |= 0004; |
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
sub r_not { |
|
241
|
4
|
50
|
|
4
|
0
|
14
|
$W & 1 and $VAL &= ~0400; |
|
242
|
4
|
100
|
|
|
|
10
|
$W & 2 and $VAL &= ~0040; |
|
243
|
4
|
100
|
|
|
|
11
|
$W & 4 and $VAL &= ~0004; |
|
244
|
|
|
|
|
|
|
} |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
sub w_or { |
|
248
|
1
|
50
|
|
1
|
0
|
4
|
$W & 1 and $VAL |= 0200; |
|
249
|
1
|
50
|
|
|
|
3
|
$W & 2 and $VAL |= 0020; |
|
250
|
1
|
50
|
|
|
|
4
|
$W & 4 and $VAL |= 0002; |
|
251
|
|
|
|
|
|
|
} |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub w_not { |
|
255
|
2
|
100
|
|
2
|
0
|
7
|
$W & 1 and $VAL &= ~0200; |
|
256
|
2
|
100
|
|
|
|
7
|
$W & 2 and $VAL &= ~0020; |
|
257
|
2
|
50
|
|
|
|
7
|
$W & 4 and $VAL &= ~0002; |
|
258
|
|
|
|
|
|
|
} |
|
259
|
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
sub x_or { |
|
262
|
1
|
0
|
|
1
|
0
|
5
|
if ($VAL & 02000){ $DEBUG and carp($ERROR{ENEXLOC}), return } |
|
|
0
|
50
|
|
|
|
0
|
|
|
263
|
1
|
50
|
|
|
|
4
|
$W & 1 and $VAL |= 0100; |
|
264
|
1
|
50
|
|
|
|
3
|
$W & 2 and $VAL |= 0010; |
|
265
|
1
|
50
|
|
|
|
3
|
$W & 4 and $VAL |= 0001; |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
sub x_not { |
|
270
|
1
|
50
|
|
1
|
0
|
3
|
$W & 1 and $VAL &= ~0100; |
|
271
|
1
|
50
|
|
|
|
4
|
$W & 2 and $VAL &= ~0010; |
|
272
|
1
|
50
|
|
|
|
3
|
$W & 4 and $VAL &= ~0001; |
|
273
|
|
|
|
|
|
|
} |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
sub s_or { |
|
277
|
0
|
0
|
|
0
|
0
|
0
|
if ($VAL & 02000){ $DEBUG and carp($ERROR{ENSGLOC}), return } |
|
|
0
|
0
|
|
|
|
0
|
|
|
278
|
0
|
0
|
|
|
|
0
|
if (not $VAL & 00100){ $DEBUG and carp($ERROR{ENEXUID}), return } |
|
|
0
|
0
|
|
|
|
0
|
|
|
279
|
0
|
0
|
|
|
|
0
|
if (not $VAL & 00010){ $DEBUG and carp($ERROR{ENEXGID}), return } |
|
|
0
|
0
|
|
|
|
0
|
|
|
280
|
0
|
0
|
|
|
|
0
|
$W & 1 and $VAL |= 04000; |
|
281
|
0
|
0
|
|
|
|
0
|
$W & 2 and $VAL |= 02000; |
|
282
|
0
|
0
|
0
|
|
|
0
|
$W & 4 and $DEBUG and carp $ERROR{ENULSID}; |
|
283
|
|
|
|
|
|
|
} |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub s_not { |
|
287
|
0
|
0
|
|
0
|
0
|
0
|
$W & 1 and $VAL &= ~04000; |
|
288
|
0
|
0
|
|
|
|
0
|
$W & 2 and $VAL &= ~02000; |
|
289
|
0
|
0
|
0
|
|
|
0
|
$W & 4 and $DEBUG and carp $ERROR{ENULSID}; |
|
290
|
|
|
|
|
|
|
} |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
sub l_or { |
|
294
|
0
|
0
|
|
0
|
0
|
0
|
if ($VAL & 02010){ $DEBUG and carp ($ERROR{ENLOCSG}), return } |
|
|
0
|
0
|
|
|
|
0
|
|
|
295
|
0
|
0
|
|
|
|
0
|
if ($VAL & 00010){ $DEBUG and carp ($ERROR{ENLOCEX}), return } |
|
|
0
|
0
|
|
|
|
0
|
|
|
296
|
0
|
|
|
|
|
0
|
$VAL |= 02000; |
|
297
|
|
|
|
|
|
|
} |
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
sub l_not { |
|
301
|
0
|
0
|
|
0
|
0
|
0
|
$VAL &= ~02000 if not $VAL & 00010; |
|
302
|
|
|
|
|
|
|
} |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
sub t_or { |
|
306
|
3
|
50
|
66
|
3
|
0
|
409
|
$W & 1 and $DEBUG and carp $ERROR{ENULSBU}; |
|
307
|
3
|
50
|
66
|
|
|
200
|
$W & 2 and $DEBUG and carp $ERROR{ENULSBG}; |
|
308
|
3
|
100
|
|
|
|
19
|
$W & 4 and $VAL |= 01000; |
|
309
|
|
|
|
|
|
|
} |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
sub t_not { |
|
313
|
2
|
50
|
66
|
2
|
0
|
187
|
$W & 1 and $DEBUG and carp $ERROR{ENULSBU}; |
|
314
|
2
|
50
|
66
|
|
|
170
|
$W & 2 and $DEBUG and carp $ERROR{ENULSBG}; |
|
315
|
2
|
50
|
|
|
|
11
|
$W & 4 and $VAL &= ~01000; |
|
316
|
|
|
|
|
|
|
} |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
1; |
|
320
|
|
|
|
|
|
|
# ABSTRACT: Implements symbolic and ls chmod modes |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
__END__ |