1 |
<!-- Creator : groff version 1.22.3 --> |
2 |
<!-- CreationDate: Mon Jul 10 02:32:54 2017 --> |
3 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
4 |
"http://www.w3.org/TR/html4/loose.dtd"> |
5 |
<html> |
6 |
<head> |
7 |
<meta name="generator" content="groff -Thtml, see www.gnu.org"> |
8 |
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> |
9 |
<meta name="Content-Style" content="text/css"> |
10 |
<style type="text/css"> |
11 |
p { margin-top: 0; margin-bottom: 0; vertical-align: top } |
12 |
pre { margin-top: 0; margin-bottom: 0; vertical-align: top } |
13 |
table { margin-top: 0; margin-bottom: 0; vertical-align: top } |
14 |
h1 { text-align: center } |
15 |
</style> |
16 |
<title></title> |
17 |
</head> |
18 |
<body> |
19 |
|
20 |
<hr> |
21 |
|
22 |
|
23 |
<p>ARCHIVE_ENTRY_PERMS(3) BSD Library Functions Manual |
24 |
ARCHIVE_ENTRY_PERMS(3)</p> |
25 |
|
26 |
<p style="margin-top: 1em"><b>NAME</b></p> |
27 |
|
28 |
<p style="margin-left:6%;"><b>archive_entry_gid</b>, |
29 |
<b>archive_entry_set_gid</b>, <b>archive_entry_uid</b>, |
30 |
<b>archive_entry_set_uid</b>, <b>archive_entry_perm</b>, |
31 |
<b>archive_entry_set_perm</b>, <b>archive_entry_strmode</b>, |
32 |
<b>archive_entry_uname</b>, <b>archive_entry_uname_w</b>, |
33 |
<b>archive_entry_set_uname</b>, |
34 |
<b>archive_entry_copy_uname</b>, |
35 |
<b>archive_entry_copy_uname_w</b>, |
36 |
<b>archive_entry_update_uname_utf8</b>, |
37 |
<b>archive_entry_gname</b>, <b>archive_entry_gname_w</b>, |
38 |
<b>archive_entry_set_gname</b>, |
39 |
<b>archive_entry_copy_gname</b>, |
40 |
<b>archive_entry_copy_gname_w</b>, |
41 |
<b>archive_entry_update_gname_utf8</b>, |
42 |
<b>archive_entry_fflags</b>, |
43 |
<b>archive_entry_fflags_text</b>, |
44 |
<b>archive_entry_set_fflags</b>, |
45 |
<b>archive_entry_copy_fflags_text</b>, |
46 |
<b>archive_entry_copy_fflags_text_w</b> — functions |
47 |
for manipulating ownership and permissions in archive entry |
48 |
descriptions</p> |
49 |
|
50 |
<p style="margin-top: 1em"><b>LIBRARY</b></p> |
51 |
|
52 |
<p style="margin-left:6%;">Streaming Archive Library |
53 |
(libarchive, -larchive)</p> |
54 |
|
55 |
<p style="margin-top: 1em"><b>SYNOPSIS</b></p> |
56 |
|
57 |
<p style="margin-left:6%;"><b>#include |
58 |
<archive_entry.h></b></p> |
59 |
|
60 |
|
61 |
<p style="margin-left:6%; margin-top: 1em"><i>gid_t</i></p> |
62 |
|
63 |
|
64 |
<p style="margin-left:12%;"><b>archive_entry_gid</b>(<i>struct archive_entry *a</i>);</p> |
65 |
|
66 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
67 |
|
68 |
|
69 |
<p style="margin-left:12%;"><b>archive_entry_set_gid</b>(<i>struct archive_entry *a</i>, |
70 |
<i>gid_t gid</i>);</p> |
71 |
|
72 |
|
73 |
<p style="margin-left:6%; margin-top: 1em"><i>uid_t</i></p> |
74 |
|
75 |
|
76 |
<p style="margin-left:12%;"><b>archive_entry_uid</b>(<i>struct archive_entry *a</i>);</p> |
77 |
|
78 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
79 |
|
80 |
|
81 |
<p style="margin-left:12%;"><b>archive_entry_set_uid</b>(<i>struct archive_entry *a</i>, |
82 |
<i>uid_t uid</i>);</p> |
83 |
|
84 |
|
85 |
<p style="margin-left:6%; margin-top: 1em"><i>mode_t</i></p> |
86 |
|
87 |
|
88 |
<p style="margin-left:12%;"><b>archive_entry_perm</b>(<i>struct archive_entry *a</i>);</p> |
89 |
|
90 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
91 |
|
92 |
|
93 |
<p style="margin-left:12%;"><b>archive_entry_set_perm</b>(<i>struct archive_entry *a</i>, |
94 |
<i>mode_t mode</i>);</p> |
95 |
|
96 |
<p style="margin-left:6%; margin-top: 1em"><i>const char |
97 |
*</i></p> |
98 |
|
99 |
|
100 |
<p style="margin-left:12%;"><b>archive_entry_strmode</b>(<i>struct archive_entry *a</i>);</p> |
101 |
|
102 |
<p style="margin-left:6%; margin-top: 1em"><i>const char |
103 |
*</i></p> |
104 |
|
105 |
|
106 |
<p style="margin-left:12%;"><b>archive_entry_gname</b>(<i>struct archive_entry *a</i>);</p> |
107 |
|
108 |
<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t |
109 |
*</i></p> |
110 |
|
111 |
|
112 |
<p style="margin-left:12%;"><b>archive_entry_gname_w</b>(<i>struct archive_entry *a</i>);</p> |
113 |
|
114 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
115 |
|
116 |
|
117 |
<p style="margin-left:12%;"><b>archive_entry_set_gname</b>(<i>struct archive_entry *a</i>, |
118 |
<i>const char *a</i>);</p> |
119 |
|
120 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
121 |
|
122 |
|
123 |
<p style="margin-left:12%;"><b>archive_entry_copy_gname</b>(<i>struct archive_entry *a</i>, |
124 |
<i>const char *name</i>);</p> |
125 |
|
126 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
127 |
|
128 |
|
129 |
<p style="margin-left:12%;"><b>archive_entry_copy_gname_w</b>(<i>struct archive_entry *a</i>, |
130 |
<i>const wchar_t *name</i>);</p> |
131 |
|
132 |
<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> |
133 |
|
134 |
|
135 |
<p style="margin-left:12%;"><b>archive_entry_update_gname_utf8</b>(<i>struct archive_entry *a</i>, |
136 |
<i>const char *name</i>);</p> |
137 |
|
138 |
<p style="margin-left:6%; margin-top: 1em"><i>const char |
139 |
*</i></p> |
140 |
|
141 |
|
142 |
<p style="margin-left:12%;"><b>archive_entry_uname</b>(<i>struct archive_entry *a</i>);</p> |
143 |
|
144 |
<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t |
145 |
*</i></p> |
146 |
|
147 |
|
148 |
<p style="margin-left:12%;"><b>archive_entry_uname_w</b>(<i>struct archive_entry *a</i>);</p> |
149 |
|
150 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
151 |
|
152 |
|
153 |
<p style="margin-left:12%;"><b>archive_entry_set_uname</b>(<i>struct archive_entry *a</i>, |
154 |
<i>const char *name</i>);</p> |
155 |
|
156 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
157 |
|
158 |
|
159 |
<p style="margin-left:12%;"><b>archive_entry_copy_uname</b>(<i>struct archive_entry *a</i>, |
160 |
<i>const char *name</i>);</p> |
161 |
|
162 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
163 |
|
164 |
|
165 |
<p style="margin-left:12%;"><b>archive_entry_copy_uname_w</b>(<i>struct archive_entry *a</i>, |
166 |
<i>const wchar_t *name</i>);</p> |
167 |
|
168 |
<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> |
169 |
|
170 |
|
171 |
<p style="margin-left:12%;"><b>archive_entry_update_uname_utf8</b>(<i>struct archive_entry *a</i>, |
172 |
<i>const char *name</i>);</p> |
173 |
|
174 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
175 |
|
176 |
|
177 |
<p><b>archive_entry_fflags</b>(<i>struct archive_entry *a</i>, |
178 |
<i>unsigned long *set_bits</i>, |
179 |
<i>unsigned long *clear_bits</i>);</p> |
180 |
|
181 |
<p style="margin-left:6%; margin-top: 1em"><i>const char |
182 |
*</i></p> |
183 |
|
184 |
|
185 |
<p style="margin-left:12%;"><b>archive_entry_fflags_text</b>(<i>struct archive_entry *a</i>);</p> |
186 |
|
187 |
<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> |
188 |
|
189 |
|
190 |
<p><b>archive_entry_set_fflags</b>(<i>struct archive_entry *a</i>, |
191 |
<i>unsigned long set_bits</i>, |
192 |
<i>unsigned long clear_bits</i>);</p> |
193 |
|
194 |
<p style="margin-left:6%; margin-top: 1em"><i>const char |
195 |
*</i></p> |
196 |
|
197 |
|
198 |
<p style="margin-left:12%;"><b>archive_entry_copy_fflags_text</b>(<i>struct archive_entry *a</i>, |
199 |
<i>const char *text</i>);</p> |
200 |
|
201 |
<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t |
202 |
*</i></p> |
203 |
|
204 |
|
205 |
<p style="margin-left:12%;"><b>archive_entry_copy_fflags_text_w</b>(<i>struct archive_entry *a</i>, |
206 |
<i>const wchar_t *text</i>);</p> |
207 |
|
208 |
<p style="margin-top: 1em"><b>DESCRIPTION</b></p> |
209 |
|
210 |
<p style="margin-left:6%;"><b>User id, group id and |
211 |
mode</b> <br> |
212 |
The functions <b>archive_entry_uid</b>(), |
213 |
<b>archive_entry_gid</b>(), and <b>archive_entry_perm</b>() |
214 |
can be used to extract the user id, group id and permission |
215 |
from the given entry. The corresponding functions |
216 |
<b>archive_entry_set_uid</b>(), |
217 |
<b>archive_entry_set_gid</b>(), and |
218 |
<b>archive_entry_set_perm</b>() store the given user id, |
219 |
group id and permission in the entry. The permission is also |
220 |
set as side effect of calling |
221 |
<b>archive_entry_set_mode</b>().</p> |
222 |
|
223 |
|
224 |
<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_strmode</b>() |
225 |
returns a string representation of the permission as used by |
226 |
the long mode of ls(1).</p> |
227 |
|
228 |
<p style="margin-left:6%; margin-top: 1em"><b>User and |
229 |
group name</b> <br> |
230 |
User and group names can be provided in one of three |
231 |
different ways:</p> |
232 |
|
233 |
<p style="margin-top: 1em">char *</p> |
234 |
|
235 |
<p style="margin-left:21%; margin-top: 1em">Multibyte |
236 |
strings in the current locale.</p> |
237 |
|
238 |
<p style="margin-top: 1em">wchar_t *</p> |
239 |
|
240 |
<p style="margin-left:21%; margin-top: 1em">Wide character |
241 |
strings in the current locale. The accessor functions are |
242 |
named <b>XXX_w</b>().</p> |
243 |
|
244 |
<p style="margin-top: 1em">UTF-8</p> |
245 |
|
246 |
<p style="margin-left:21%; margin-top: 1em">Unicode strings |
247 |
encoded as UTF-8. This are convience functions to update |
248 |
both the multibyte and wide character strings at the same |
249 |
time.</p> |
250 |
|
251 |
|
252 |
<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_set_XXX</b>() |
253 |
is an alias for <b>archive_entry_copy_XXX</b>().</p> |
254 |
|
255 |
<p style="margin-left:6%; margin-top: 1em"><b>File |
256 |
Flags</b> <br> |
257 |
File flags are transparently converted between a bitmap |
258 |
representation and a textual format. For example, if you set |
259 |
the bitmap and ask for text, the library will build a |
260 |
canonical text format. However, if you set a text format and |
261 |
request a text format, you will get back the same text, even |
262 |
if it is ill-formed. If you need to canonicalize a textual |
263 |
flags string, you should first set the text form, then |
264 |
request the bitmap form, then use that to set the bitmap |
265 |
form. Setting the bitmap format will clear the internal text |
266 |
representation and force it to be reconstructed when you |
267 |
next request the text form.</p> |
268 |
|
269 |
<p style="margin-left:6%; margin-top: 1em">The bitmap |
270 |
format consists of two integers, one containing bits that |
271 |
should be set, the other specifying bits that should be |
272 |
cleared. Bits not mentioned in either bitmap will be |
273 |
ignored. Usually, the bitmap of bits to be cleared will be |
274 |
set to zero. In unusual circumstances, you can force a |
275 |
fully-specified set of file flags by setting the bitmap of |
276 |
flags to clear to the complement of the bitmap of flags to |
277 |
set. (This differs from fflagstostr(3), which only includes |
278 |
names for set bits.) Converting a bitmap to a textual string |
279 |
is a platform-specific operation; bits that are not |
280 |
meaningful on the current platform will be ignored.</p> |
281 |
|
282 |
<p style="margin-left:6%; margin-top: 1em">The canonical |
283 |
text format is a comma-separated list of flag names. The |
284 |
<b>archive_entry_copy_fflags_text</b>() and |
285 |
<b>archive_entry_copy_fflags_text_w</b>() functions parse |
286 |
the provided text and sets the internal bitmap values. This |
287 |
is a platform-specific operation; names that are not |
288 |
meaningful on the current platform will be ignored. The |
289 |
function returns a pointer to the start of the first name |
290 |
that was not recognized, or NULL if every name was |
291 |
recognized. Note that every name — including names |
292 |
that follow an unrecognized name — will be evaluated, |
293 |
and the bitmaps will be set to reflect every name that is |
294 |
recognized. (In particular, this differs from |
295 |
strtofflags(3), which stops parsing at the first |
296 |
unrecognized name.)</p> |
297 |
|
298 |
<p style="margin-top: 1em"><b>SEE ALSO</b></p> |
299 |
|
300 |
<p style="margin-left:6%;">archive_entry(3), |
301 |
archive_entry_acl(3), archive_read_disk(3), |
302 |
archive_write_disk(3) libarchive(3),</p> |
303 |
|
304 |
<p style="margin-top: 1em"><b>BUGS</b></p> |
305 |
|
306 |
<p style="margin-left:6%;">The platform types <i>uid_t</i> |
307 |
and <i>gid_t</i> are often 16 or 32 bit wide. In this case |
308 |
it is possible that the ids can not be correctly restored |
309 |
from archives and get truncated.</p> |
310 |
|
311 |
<p style="margin-left:6%; margin-top: 1em">BSD |
312 |
February 2, 2012 BSD</p> |
313 |
<hr> |
314 |
</body> |
315 |
</html> |