File: archive_entry_acl.3.html

package info (click to toggle)
libarchive 3.2.2-2%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,200 kB
  • sloc: ansic: 146,240; sh: 12,349; makefile: 1,580; awk: 770
file content (271 lines) | stat: -rw-r--r-- 9,032 bytes parent folder | download
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Sun Oct 23 20:38:25 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }
</style>
<title></title>
</head>
<body>

<hr>


<p>ARCHIVE_ENTRY_ACL(3) BSD Library Functions Manual
ARCHIVE_ENTRY_ACL(3)</p>

<p style="margin-top: 1em"><b>NAME</b></p>


<p style="margin-left:6%;"><b>archive_entry_acl_add_entry</b>,
<b>archive_entry_acl_add_entry_w</b>,
<b>archive_entry_acl_clear</b>,
<b>archive_entry_acl_count</b>,
<b>archive_entry_acl_next</b>,
<b>archive_entry_acl_next_w</b>,
<b>archive_entry_acl_reset</b>,
<b>archive_entry_acl_text_w</b> &mdash; functions for
manipulating Access Control Lists in archive entry
descriptions</p>

<p style="margin-top: 1em"><b>LIBRARY</b></p>

<p style="margin-left:6%;">Streaming Archive Library
(libarchive, -larchive)</p>

<p style="margin-top: 1em"><b>SYNOPSIS</b></p>

<p style="margin-left:6%;"><b>#include
&lt;archive_entry.h&gt;</b></p>

<p style="margin-left:6%; margin-top: 1em"><i>void</i></p>


<p><b>archive_entry_acl_add_entry</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>,
<i>int&nbsp;type</i>, <i>int&nbsp;permset</i>,
<i>int&nbsp;tag</i>, <i>int&nbsp;qualifier</i>,
<i>const&nbsp;char&nbsp;*name</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>void</i></p>


<p><b>archive_entry_acl_add_entry_w</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>,
<i>int&nbsp;type</i>, <i>int&nbsp;permset</i>,
<i>int&nbsp;tag</i>, <i>int&nbsp;qualifier</i>,
<i>const&nbsp;wchar_t&nbsp;*name</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>void</i></p>


<p style="margin-left:12%;"><b>archive_entry_acl_clear</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:12%;"><b>archive_entry_acl_count</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>,
<i>int&nbsp;type</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>


<p><b>archive_entry_acl_next</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>,
<i>int&nbsp;type</i>, <i>int&nbsp;*ret_type</i>,
<i>int&nbsp;*ret_permset</i>, <i>int&nbsp;*ret_tag</i>,
<i>int&nbsp;*ret_qual</i>,
<i>const&nbsp;char&nbsp;**ret_name</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>


<p><b>archive_entry_acl_next_w</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>,
<i>int&nbsp;type</i>, <i>int&nbsp;*ret_type</i>,
<i>int&nbsp;*ret_permset</i>, <i>int&nbsp;*ret_tag</i>,
<i>int&nbsp;*ret_qual</i>,
<i>const&nbsp;wchar_t&nbsp;**ret_name</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:12%;"><b>archive_entry_acl_reset</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>,
<i>int&nbsp;type</i>);</p>

<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t
*</i></p>


<p style="margin-left:12%;"><b>archive_entry_acl_text_w</b>(<i>struct&nbsp;archive_entry&nbsp;*a</i>,
<i>int&nbsp;flags</i>);</p>

<p style="margin-top: 1em"><b>DESCRIPTION</b></p>

<p style="margin-left:6%;">An &rsquo;&rsquo;Access Control
List&rsquo;&rsquo; is a generalisation of the classic Unix
permission system. The ACL interface of <b>libarchive</b> is
derived from the POSIX.1e draft, but restricted to simplify
dealing with practical implementations in various Operating
Systems and archive formats.</p>

<p style="margin-left:6%; margin-top: 1em">An ACL consists
of a number of independent entries. Each entry specifies the
permission set as bitmask of basic permissions. Valid
permissions are:</p>

<p>ARCHIVE_ENTRY_ACL_EXECUTE <br>
ARCHIVE_ENTRY_ACL_WRITE <br>
ARCHIVE_ENTRY_ACL_READ</p>

<p style="margin-left:6%; margin-top: 1em">The permissions
correspond to the normal Unix permissions.</p>

<p style="margin-left:6%; margin-top: 1em">The tag
specifies the principal to which the permission applies.
Valid values are:</p>

<p>ARCHIVE_ENTRY_ACL_USER</p>

<p style="margin-left:51%; margin-top: 1em">The user
specified by the name field.</p>

<p>ARCHIVE_ENTRY_ACL_USER_OBJ</p>

<p style="margin-left:51%; margin-top: 1em">The owner of
the file.</p>

<p>ARCHIVE_ENTRY_ACL_GROUP</p>

<p style="margin-left:51%; margin-top: 1em">The group
specied by the name field.</p>

<p>ARCHIVE_ENTRY_ACL_GROUP_OBJ</p>

<p style="margin-left:51%; margin-top: 1em">The group who
owns the file.</p>

<p>ARCHIVE_ENTRY_ACL_MASK</p>

<p style="margin-left:51%; margin-top: 1em">The maximum
permissions to be obtained via group permissions.</p>

<p>ARCHIVE_ENTRY_ACL_OTHER</p>

<p style="margin-left:51%; margin-top: 1em">Any principal
who doesn&rsquo;t have a user or group entry.</p>

<p style="margin-left:6%;">The principals
ARCHIVE_ENTRY_ACL_USER_OBJ, ARCHIVE_ENTRY_ACL_GROUP_OBJ and
ARCHIVE_ENTRY_ACL_OTHER are equivalent to user, group and
other in the classic Unix permission model and specify
non-extended ACL entries.</p>

<p style="margin-left:6%; margin-top: 1em">All files have
an access ACL (ARCHIVE_ENTRY_ACL_TYPE_ACCESS). This
specifies the permissions required for access to the file
itself. Directories have an additional ACL
(ARCHIVE_ENTRY_ACL_TYPE_DEFAULT), which controls the initial
access ACL for newly created directory entries.</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_add_entry</b>()
and <b>archive_entry_acl_add_entry_w</b>() add a single ACL
entry. For the access ACL and non-extended principals, the
classic Unix permissions are updated.</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_clear</b>()
removes all ACL entries and resets the enumeration
pointer.</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_count</b>()
counts the ACL entries that have the given type mask.
<i>type</i> can be the bitwise-or of
ARCHIVE_ENTRY_ACL_TYPE_ACCESS and
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT. If
ARCHIVE_ENTRY_ACL_TYPE_ACCESS is included and at least one
extended ACL entry is found, the three non-extened ACLs are
added.</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_next</b>()
and <b>archive_entry_acl_next_w</b>() return the next entry
of the ACL list. This functions may only be called after
<b>archive_entry_acl_reset</b>() has indicated the presence
of extended ACL entries.</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_reset</b>()
prepare reading the list of ACL entries with
<b>archive_entry_acl_next</b>() or
<b>archive_entry_acl_next_w</b>(). The function returns
either 0, if no non-extended ACLs are found. In this case,
the access permissions should be obtained by
archive_entry_mode(3) or set using chmod(2). Otherwise, the
function returns the same value as
<b>archive_entry_acl_count</b>().</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_text_w</b>()
converts the ACL entries for the given type mask into a wide
string. In addition to the normal type flags,
ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID and
ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT can be specified to
further customize the result. The returned long string is
valid until the next call to
<b>archive_entry_acl_clear</b>(),
<b>archive_entry_acl_add_entry</b>(),
<b>archive_entry_acl_add_entry_w</b>() or
<b>archive_entry_acl_text_w</b>().</p>

<p style="margin-top: 1em"><b>RETURN VALUES</b></p>


<p style="margin-left:6%;"><b>archive_entry_acl_count</b>()
and <b>archive_entry_acl_reset</b>() returns the number of
ACL entries that match the given type mask. If the type mask
includes ARCHIVE_ENTRY_ACL_TYPE_ACCESS and at least one
extended ACL entry exists, the three classic Unix
permissions are counted.</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_next</b>()
and <b>archive_entry_acl_next_w</b>() return ARCHIVE_OK on
success, ARCHIVE_EOF if no more ACL entries exist and
ARCHIVE_WARN if <b>archive_entry_acl_reset</b>() has not
been called first.</p>


<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_text_w</b>()
returns a wide string representation of the ACL entrise
matching the given type mask. The returned long string is
valid until the next call to
<b>archive_entry_acl_clear</b>(),
<b>archive_entry_acl_add_entry</b>(),
<b>archive_entry_acl_add_entry_w</b>() or
<b>archive_entry_acl_text_w</b>().</p>

<p style="margin-top: 1em"><b>SEE ALSO</b></p>

<p style="margin-left:6%;">archive_entry(3)
libarchive(3),</p>

<p style="margin-top: 1em"><b>BUGS</b></p>


<p style="margin-left:6%;">ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
and ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT are not
documented.</p>

<p style="margin-left:6%; margin-top: 1em">BSD
February&nbsp;2, 2012 BSD</p>
<hr>
</body>
</html>