~ubuntu-branches/ubuntu/quantal/libarchive/quantal

« back to all changes in this revision

Viewing changes to doc/man/archive_entry_perms.3

  • Committer: Package Import Robot
  • Author(s): Andres Mejia
  • Date: 2012-02-23 19:29:24 UTC
  • mfrom: (8.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120223192924-73n4iedok5fwgsyr
Tags: 3.0.3-5
* Detect if locales or locales-all is installed for use with test suite.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH ARCHIVE_ENTRY_PERMS 3 "February 22, 2010" ""
 
2
.SH NAME
 
3
.ad l
 
4
\fB\%archive_entry_gid\fP,
 
5
\fB\%archive_entry_set_gid\fP,
 
6
\fB\%archive_entry_uid\fP,
 
7
\fB\%archive_entry_set_uid\fP,
 
8
\fB\%archive_entry_perm\fP,
 
9
\fB\%archive_entry_set_perm\fP,
 
10
\fB\%archive_entry_strmode\fP,
 
11
\fB\%archive_entry_uname\fP
 
12
\fB\%archive_entry_uname_w\fP
 
13
\fB\%archive_entry_set_uname\fP,
 
14
\fB\%archive_entry_copy_uname\fP,
 
15
\fB\%archive_entry_copy_uname_w\fP,
 
16
\fB\%archive_entry_update_uname_utf8\fP,
 
17
\fB\%archive_entry_gname\fP,
 
18
\fB\%archive_entry_gname_w\fP,
 
19
\fB\%archive_entry_set_gname\fP,
 
20
\fB\%archive_entry_copy_gname\fP,
 
21
\fB\%archive_entry_copy_gname_w\fP,
 
22
\fB\%archive_entry_update_gname_utf8\fP,
 
23
\fB\%archive_entry_fflags\fP,
 
24
\fB\%archive_entry_fflags_text\fP,
 
25
\fB\%archive_entry_set_fflags\fP,
 
26
\fB\%archive_entry_copy_fflags_text\fP,
 
27
\fB\%archive_entry_copy_fflags_text_w\fP
 
28
\- functions for manipulating ownership and permissions in archive entry descriptions
 
29
.SH SYNOPSIS
 
30
.ad l
 
31
\fB#include <archive_entry.h>\fP
 
32
.br
 
33
\fIgid_t\fP
 
34
.br
 
35
\fB\%archive_entry_gid\fP(\fI\%struct\ archive_entry\ *a\fP);
 
36
.br
 
37
\fIvoid\fP
 
38
.br
 
39
\fB\%archive_entry_set_gid\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%gid_t\ gid\fP);
 
40
.br
 
41
\fIuid_t\fP
 
42
.br
 
43
\fB\%archive_entry_uid\fP(\fI\%struct\ archive_entry\ *a\fP);
 
44
.br
 
45
\fIvoid\fP
 
46
.br
 
47
\fB\%archive_entry_set_uid\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%uid_t\ uid\fP);
 
48
.br
 
49
\fImode_t\fP
 
50
.br
 
51
\fB\%archive_entry_perm\fP(\fI\%struct\ archive_entry\ *a\fP);
 
52
.br
 
53
\fIvoid\fP
 
54
.br
 
55
\fB\%archive_entry_set_perm\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%mode_t\ mode\fP);
 
56
.br
 
57
\fIconst char *\fP
 
58
.br
 
59
\fB\%archive_entry_strmode\fP(\fI\%struct\ archive_entry\ *a\fP);
 
60
.br
 
61
\fIconst char *\fP
 
62
.br
 
63
\fB\%archive_entry_gname\fP(\fI\%struct\ archive_entry\ *a\fP);
 
64
.br
 
65
\fIconst wchar_t *\fP
 
66
.br
 
67
\fB\%archive_entry_gname_w\fP(\fI\%struct\ archive_entry\ *a\fP);
 
68
.br
 
69
\fIvoid\fP
 
70
.br
 
71
\fB\%archive_entry_set_gname\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *a\fP);
 
72
.br
 
73
\fIvoid\fP
 
74
.br
 
75
\fB\%archive_entry_copy_gname\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *name\fP);
 
76
.br
 
77
\fIvoid\fP
 
78
.br
 
79
\fB\%archive_entry_copy_gname_w\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ wchar_t\ *name\fP);
 
80
.br
 
81
\fIint\fP
 
82
.br
 
83
\fB\%archive_entry_update_gname_utf8\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *name\fP);
 
84
.br
 
85
\fIconst char *\fP
 
86
.br
 
87
\fB\%archive_entry_uname\fP(\fI\%struct\ archive_entry\ *a\fP);
 
88
.br
 
89
\fIconst wchar_t *\fP
 
90
.br
 
91
\fB\%archive_entry_uname_w\fP(\fI\%struct\ archive_entry\ *a\fP);
 
92
.br
 
93
\fIvoid\fP
 
94
.br
 
95
\fB\%archive_entry_set_uname\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *name\fP);
 
96
.br
 
97
\fIvoid\fP
 
98
.br
 
99
\fB\%archive_entry_copy_uname\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *name\fP);
 
100
.br
 
101
\fIvoid\fP
 
102
.br
 
103
\fB\%archive_entry_copy_uname_w\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ wchar_t\ *name\fP);
 
104
.br
 
105
\fIint\fP
 
106
.br
 
107
\fB\%archive_entry_update_uname_utf8\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *name\fP);
 
108
.br
 
109
\fIvoid\fP
 
110
.br
 
111
\fB\%archive_entry_fflags\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%unsigned\ long\ *set_bits\fP, \fI\%unsigned\ long\ *clear_bits\fP);
 
112
.br
 
113
\fIconst char *\fP
 
114
.br
 
115
\fB\%archive_entry_fflags_text\fP(\fI\%struct\ archive_entry\ *a\fP);
 
116
.br
 
117
\fIvoid\fP
 
118
.br
 
119
\fB\%archive_entry_set_fflags\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%unsigned\ long\ set_bits\fP, \fI\%unsigned\ long\ clear_bits\fP);
 
120
.br
 
121
\fIconst char *\fP
 
122
.br
 
123
\fB\%archive_entry_copy_fflags_text\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *text\fP);
 
124
.br
 
125
\fIconst wchar_t *\fP
 
126
.br
 
127
\fB\%archive_entry_copy_fflags_text_w\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ wchar_t\ *text\fP);
 
128
.SH DESCRIPTION
 
129
.ad l
 
130
.SS User id, group id and mode
 
131
The functions
 
132
\fB\%archive_entry_uid\fP(),
 
133
\fB\%archive_entry_gid\fP(),
 
134
and
 
135
\fB\%archive_entry_perm\fP()
 
136
can be used to extract the user id, group id and permission from the given entry.
 
137
The corresponding functions
 
138
\fB\%archive_entry_set_uid\fP(),
 
139
\fB\%archive_entry_set_gid\fP(),
 
140
and
 
141
\fB\%archive_entry_set_perm\fP()
 
142
store the given user id, group id and permission in the entry.
 
143
The permission is also set as side effect of calling
 
144
\fB\%archive_entry_set_mode\fP().
 
145
.PP
 
146
\fB\%archive_entry_strmode\fP()
 
147
returns a string representation of the permission as used by the long mode of
 
148
\fBls\fP(1).
 
149
.SS User and group name
 
150
User and group names can be provided in one of three different ways:
 
151
.RS 5
 
152
.TP
 
153
char *
 
154
Multibyte strings in the current locale.
 
155
.TP
 
156
wchar_t *
 
157
Wide character strings in the current locale.
 
158
The accessor functions are named
 
159
\fB\%XXX_w\fP().
 
160
.TP
 
161
UTF-8
 
162
Unicode strings encoded as UTF-8.
 
163
This are convience functions to update both the multibyte and wide
 
164
character strings at the same time.
 
165
.RE
 
166
.PP
 
167
\fB\%archive_entry_set_XXX\fP()
 
168
is an alias for 
 
169
\fB\%archive_entry_copy_XXX\fP().
 
170
.SS File Flags
 
171
File flags are transparently converted between a bitmap
 
172
representation and a textual format.
 
173
For example, if you set the bitmap and ask for text, the library
 
174
will build a canonical text format.
 
175
However, if you set a text format and request a text format,
 
176
you will get back the same text, even if it is ill-formed.
 
177
If you need to canonicalize a textual flags string, you should first set the
 
178
text form, then request the bitmap form, then use that to set the bitmap form.
 
179
Setting the bitmap format will clear the internal text representation
 
180
and force it to be reconstructed when you next request the text form.
 
181
.PP
 
182
The bitmap format consists of two integers, one containing bits
 
183
that should be set, the other specifying bits that should be
 
184
cleared.
 
185
Bits not mentioned in either bitmap will be ignored.
 
186
Usually, the bitmap of bits to be cleared will be set to zero.
 
187
In unusual circumstances, you can force a fully-specified set
 
188
of file flags by setting the bitmap of flags to clear to the complement
 
189
of the bitmap of flags to set.
 
190
(This differs from
 
191
\fBfflagstostr\fP(3),
 
192
which only includes names for set bits.)
 
193
Converting a bitmap to a textual string is a platform-specific
 
194
operation; bits that are not meaningful on the current platform
 
195
will be ignored.
 
196
.PP
 
197
The canonical text format is a comma-separated list of flag names.
 
198
The
 
199
\fB\%archive_entry_copy_fflags_text\fP()
 
200
and
 
201
\fB\%archive_entry_copy_fflags_text_w\fP()
 
202
functions parse the provided text and sets the internal bitmap values.
 
203
This is a platform-specific operation; names that are not meaningful
 
204
on the current platform will be ignored.
 
205
The function returns a pointer to the start of the first name that was not
 
206
recognized, or NULL if every name was recognized.
 
207
Note that every name \(em including names that follow an unrecognized
 
208
name \(em will be evaluated, and the bitmaps will be set to reflect
 
209
every name that is recognized.
 
210
(In particular, this differs from
 
211
\fBstrtofflags\fP(3),
 
212
which stops parsing at the first unrecognized name.)
 
213
.SH SEE ALSO
 
214
.ad l
 
215
\fBarchive\fP(3),
 
216
\fBarchive_entry\fP(3),
 
217
\fBarchive_entry_acl\fP(3),
 
218
\fBarchive_read_disk\fP(3),
 
219
\fBarchive_write_disk\fP(3)
 
220
.SH BUGS
 
221
.ad l
 
222
The platform types
 
223
Vt uid_t
 
224
and
 
225
Vt gid_t
 
226
are often 16 or 32 bit wide.
 
227
In this case it is possible that the ids can not be correctly restored
 
228
from archives and get truncated.