summaryrefslogtreecommitdiff
path: root/man/man3/acl_to_any_text.3
blob: fd3cf74272371c8cbfd9c8e9f2597a7b9d102902 (plain)
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
.\" Access Control Lists manual pages
.\"
.\" (C) 2002 Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual.  If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.Dd March 25, 2002
.Dt ACL_TO_ANY_TEXT 3
.Os "Linux ACL"
.Sh NAME
.Nm acl_to_any_text
.Nd convert an ACL to text
.Sh LIBRARY
Linux Access Control Lists library (libacl, \-lacl).
.Sh SYNOPSIS
.In sys/types.h
.In acl/libacl.h
.Ft char *
.Fo acl_to_any_text
.Fa "acl_t acl"
.Fa "const char *prefix"
.Fa "char separator"
.Fa "int options"
.Fc
.Sh DESCRIPTION
The
.Fn acl_to_any_text
function translates the ACL pointed to by the argument
.Va acl
into a
.Li NULL
terminated character string. This character string
is composed of the ACL entries contained in
.Va acl ,
in the entry text format described on
.Xr acl 5 .
Entries are separated from each other by the
.Va separator
character. If the argument
.Va prefix
is not
.Li (const char *)NULL ,
each entry is prefixed by this character string.
.Pp
If the argument
.Va options
is
.Li 0 ,
ACL entries are converted using the entry tag type keywords
.Li user , group , mask ,
and
.Li other .
User IDs and group IDs of ACL entries that contain such
qualifiers are converted to their corresponding names; if an identifier
has no corresponding name, a decimal number string is produced. The
ACL text representation contains no additional comments.
A bitwise combinations of the following
.Va options
can be used to modify the result:
.Bl -tag
.It TEXT_ABBREVIATE
Instead of the full tag type keywords, single letter abbreviations are used.
The abbreviation for
.Li user
is
.Li u ,
the abbreviation for
.Li group
is
.Li g ,
the abbreviation for
.Li mask
is
.Li m ,
and the abbreviation for
.Li other
is
.Li o .
.It TEXT_NUMERIC_IDS
User IDs and group IDs are included as decimal numbers instead of names.
.It TEXT_SOME_EFFECTIVE
A comment containing the effective permissions of the ACL entry is
included after ACL entries that contain permissions which are ineffective
because they are masked by an ACL_MASK entry. The ACL entry and the comment
are separated by a tab character.
.It TEXT_ALL_EFFECTIVE
A comment containing the effective permissions of the ACL entry is
included after all ACL entries that are affected by an ACL_MASK entry.
The comment is included even if the permissions contained in the ACL
entry equal the effective permissions. The ACL entry and the comment are
separated by a tab character.
.It TEXT_SMART_INDENT
This option is used in combination with the TEXT_SOME_EFFECTIVE or
TEXT_ALL_EFFECTIVE option. The number of tab characters inserted between
the ACL entry and the comment is increased so that the comment is
aligned to the fourth tab stop position.
A tab width of 8 characters is assumed.
.El
.Pp
The ACL referred to by
.Va acl
is not changed.
.Pp
This function allocates any memory necessary to contain the string and
returns a pointer to the string.  The caller should free any releasable
memory, when the new string is no longer required, by calling
.Fn acl_free
with the
.Va (void*)char
returned by
.Fn acl_to_any_text
as an argument.
.Sh RETURN VALUE
On success, this function returns a pointer to the text
representation of the ACL.  On error, a value of
.Li (char *)NULL
is returned, and
.Va errno
is set appropriately.
.Sh ERRORS
If any of the following conditions occur, the
.Fn acl_to_any_text
function returns a value of
.Li (char *)NULL
and sets
.Va errno
to the corresponding value:
.Bl -tag -width Er
.It Bq Er EINVAL
The argument
.Va acl
is not a valid pointer to an ACL.
.Pp
The ACL referenced by
.Va acl
contains one or more improperly formed ACL entries, or for some other
reason cannot be translated into the text form of an ACL.
.It Bq Er ENOMEM
The character string to be returned requires more memory than is allowed
by the hardware or system-imposed memory management constraints.
.El
.Sh STANDARDS
This is a non-portable, Linux specific extension to the ACL manipulation
functions defined in IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned).
.Sh SEE ALSO
.Xr acl_from_text 3 ,
.Xr acl_to_text 3 ,
.Xr acl_free 3 ,
.Xr acl 5
.Sh AUTHOR
Written by
.An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .