line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2014, cPanel, Inc. |
2
|
|
|
|
|
|
|
# All rights reserved. |
3
|
|
|
|
|
|
|
# http://cpanel.net/ |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the same |
6
|
|
|
|
|
|
|
# terms as Perl itself. See the LICENSE file for further details. |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Filesys::POSIX::Bits; |
9
|
|
|
|
|
|
|
|
10
|
29
|
|
|
29
|
|
2490
|
use strict; |
|
29
|
|
|
|
|
28
|
|
|
29
|
|
|
|
|
593
|
|
11
|
29
|
|
|
29
|
|
78
|
use warnings; |
|
29
|
|
|
|
|
31
|
|
|
29
|
|
|
|
|
606
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
BEGIN { |
14
|
29
|
|
|
29
|
|
94
|
use Exporter (); |
|
29
|
|
|
|
|
30
|
|
|
29
|
|
|
|
|
478
|
|
15
|
29
|
|
|
29
|
|
95
|
use vars qw(@ISA @EXPORT); |
|
29
|
|
|
|
|
27
|
|
|
29
|
|
|
|
|
2537
|
|
16
|
|
|
|
|
|
|
|
17
|
29
|
|
|
29
|
|
209
|
our @ISA = qw(Exporter); |
18
|
|
|
|
|
|
|
|
19
|
29
|
|
|
|
|
10110
|
our @EXPORT = qw( |
20
|
|
|
|
|
|
|
$O_RDONLY $O_WRONLY $O_RDWR $O_NONBLOCK $O_APPEND $O_CREAT $O_TRUNC |
21
|
|
|
|
|
|
|
$O_EXCL $O_SHLOCK $O_EXLOCK $O_NOFOLLOW $O_EVTONLY $S_IFMT |
22
|
|
|
|
|
|
|
$S_IFIFO $S_IFCHR $S_IFDIR $S_IFBLK $S_IFREG $S_IFLNK $S_IFSOCK |
23
|
|
|
|
|
|
|
$S_IFWHT $S_IPROT $S_ISUID $S_ISGID $S_ISVTX $S_IPERM $S_IRWXU |
24
|
|
|
|
|
|
|
$S_IRUSR $S_IWUSR $S_IXUSR $S_IRWXG $S_IRGRP $S_IWGRP $S_IXGRP |
25
|
|
|
|
|
|
|
$S_IRWXO $S_IROTH $S_IWOTH $S_IXOTH $S_IRW $S_IR $S_IW $S_IX |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$SEEK_SET $SEEK_CUR $SEEK_END |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Filesys::POSIX::Bits - Bitfield and constant definitions for file modes and |
34
|
|
|
|
|
|
|
system call flags |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This file contains all the constant definitions for the system call flags and |
39
|
|
|
|
|
|
|
inode mode bitfields and values. The following system calls use these values: |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=over |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item Copen> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Uses both flag and mode specifiers for determining permissions, file open mode, |
46
|
|
|
|
|
|
|
and inode format. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item Cseek> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Uses C<$SEEK_SET>, C<$SEEK_CUR>, and C<$SEEK_END> for the $whence argument. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=back |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# |
57
|
|
|
|
|
|
|
# Flags as recognized by open() |
58
|
|
|
|
|
|
|
# |
59
|
|
|
|
|
|
|
our $O_MODE = 0x0003; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
our $O_RDONLY = 0x0000; |
62
|
|
|
|
|
|
|
our $O_WRONLY = 0x0001; |
63
|
|
|
|
|
|
|
our $O_RDWR = 0x0002; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
our $O_SYNC = 0x0080; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
our $O_SHLOCK = 0x0010; |
68
|
|
|
|
|
|
|
our $O_EXLOCK = 0x0020; |
69
|
|
|
|
|
|
|
our $O_ASYNC = 0x0040; |
70
|
|
|
|
|
|
|
our $O_FSYNC = $O_SYNC; |
71
|
|
|
|
|
|
|
our $O_NOFOLLOW = 0x0100; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
our $O_CREAT = 0x0200; |
74
|
|
|
|
|
|
|
our $O_TRUNC = 0x0400; |
75
|
|
|
|
|
|
|
our $O_EXCL = 0x0800; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
our $O_NONBLOCK = 0x0004; |
78
|
|
|
|
|
|
|
our $O_APPEND = 0x0008; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
our $O_EVTONLY = 0x8000; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
# |
83
|
|
|
|
|
|
|
# Inode format bitfield and values |
84
|
|
|
|
|
|
|
# |
85
|
|
|
|
|
|
|
our $S_IFMT = 0170000; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
our $S_IFIFO = 0010000; |
88
|
|
|
|
|
|
|
our $S_IFCHR = 0020000; |
89
|
|
|
|
|
|
|
our $S_IFDIR = 0040000; |
90
|
|
|
|
|
|
|
our $S_IFBLK = 0060000; |
91
|
|
|
|
|
|
|
our $S_IFREG = 0100000; |
92
|
|
|
|
|
|
|
our $S_IFLNK = 0120000; |
93
|
|
|
|
|
|
|
our $S_IFSOCK = 0140000; |
94
|
|
|
|
|
|
|
our $S_IFWHT = 0160000; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
# |
97
|
|
|
|
|
|
|
# Inode execution protection bitfield and values |
98
|
|
|
|
|
|
|
# |
99
|
|
|
|
|
|
|
our $S_IPROT = 0007000; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
our $S_ISUID = 0004000; |
102
|
|
|
|
|
|
|
our $S_ISGID = 0002000; |
103
|
|
|
|
|
|
|
our $S_ISVTX = 0001000; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
# |
106
|
|
|
|
|
|
|
# Inode permission bitfield and values |
107
|
|
|
|
|
|
|
# |
108
|
|
|
|
|
|
|
our $S_IR = 0000444; |
109
|
|
|
|
|
|
|
our $S_IW = 0000222; |
110
|
|
|
|
|
|
|
our $S_IX = 0000111; |
111
|
|
|
|
|
|
|
our $S_IRW = $S_IR | $S_IW; |
112
|
|
|
|
|
|
|
our $S_IPERM = $S_IRW | $S_IX; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# Per assigned user |
115
|
|
|
|
|
|
|
our $S_IRWXU = 0000700; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
our $S_IRUSR = 0000400; |
118
|
|
|
|
|
|
|
our $S_IWUSR = 0000200; |
119
|
|
|
|
|
|
|
our $S_IXUSR = 0000100; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
# Per assigned group |
122
|
|
|
|
|
|
|
our $S_IRWXG = 0000070; |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
our $S_IRGRP = 0000040; |
125
|
|
|
|
|
|
|
our $S_IWGRP = 0000020; |
126
|
|
|
|
|
|
|
our $S_IXGRP = 0000010; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# All other users |
129
|
|
|
|
|
|
|
our $S_IRWXO = 0000007; |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
our $S_IROTH = 0000004; |
132
|
|
|
|
|
|
|
our $S_IWOTH = 0000002; |
133
|
|
|
|
|
|
|
our $S_IXOTH = 0000001; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
# |
136
|
|
|
|
|
|
|
# seek() operations |
137
|
|
|
|
|
|
|
# |
138
|
|
|
|
|
|
|
our $SEEK_SET = 0x00; |
139
|
|
|
|
|
|
|
our $SEEK_CUR = 0x01; |
140
|
|
|
|
|
|
|
our $SEEK_END = 0x02; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
1; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
__END__ |