-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathstrperm.3
109 lines (109 loc) · 1.82 KB
/
strperm.3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.fp 5 CW
.de Af
.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
..
.de aF
.ie \\$3 .ft \\$1
.el \{\
.ds ;G \&
.nr ;G \\n(.f
.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
\\*(;G
.ft \\n(;G \}
..
.de L
.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
..
.de LR
.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
..
.de RL
.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
..
.de EX \" start example
.ta 1i 2i 3i 4i 5i 6i
.PP
.RS
.PD 0
.ft 5
.nf
..
.de EE \" end example
.fi
.ft
.PD
.RE
.PP
..
.TH STRPERM 3
.SH NAME
strperm \- evaluate file permission expression
.SH SYNOPSIS
.L "int strperm(const char* s, char** e, int p)"
.SH DESCRIPTION
.I strperm
applies a file permission expression in the null-terminated string
.I s
to the initial file permission mask
.IR p .
The new permission mask is returned.
If
.I e
not 0 then
.I *e
is set to point to the first unrecognized character in
.IR s .
.PP
A file permission expression is composed of one or more
.I who-op-permission
terms separated by
.BR , .
.I who
selects portions of the permission bits and may be any combination of:
.TP 3
.B u
the user permission bits;
.TP
.B g
the group permission bits;
.TP
.B o
the `other' permission bits;
.TP
.B a
all permission bits.
.PP
If omitted, all permission bits are selected.
.I op
specifies how the original permission
.I p
is to be modified:
.TP 3
.B +
.br
.ns
.B |
the new bits are set in
.IR p ;
.TP 3
.B \-
the new bits are cleared in
.IR p ;
.TP
.B &
the new bits are and'd with
.IR p ;
.TP
.B =
the select bits in
.I p
are set equal to the new bits
.PP
A permission expression term may also be an octal number.
Octal specifications are inherently non-portable.
Refer to
.IR chmod (1)
for an explanation of this form.
.SH "SEE ALSO"
chmod(1), ls(1), strmode(3)