Tizen 2.0 Release
[framework/base/acl.git] / man / man3 / acl_to_any_text.3
1 .\" Access Control Lists manual pages
2 .\"
3 .\" (C) 2002 Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
4 .\"
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual.  If not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\"
24 .Dd March 25, 2002
25 .Dt ACL_TO_ANY_TEXT 3
26 .Os "Linux ACL"
27 .Sh NAME
28 .Nm acl_to_any_text
29 .Nd convert an ACL to text
30 .Sh LIBRARY
31 Linux Access Control Lists library (libacl, \-lacl).
32 .Sh SYNOPSIS
33 .In sys/types.h
34 .In acl/libacl.h
35 .Ft char *
36 .Fo acl_to_any_text
37 .Fa "acl_t acl"
38 .Fa "const char *prefix"
39 .Fa "char separator"
40 .Fa "int options"
41 .Fc
42 .Sh DESCRIPTION
43 The
44 .Fn acl_to_any_text
45 function translates the ACL pointed to by the argument
46 .Va acl
47 into a
48 .Li NULL
49 terminated character string. This character string
50 is composed of the ACL entries contained in
51 .Va acl ,
52 in the entry text format described on
53 .Xr acl 5 .
54 Entries are separated from each other by the
55 .Va separator
56 character. If the argument
57 .Va prefix
58 is not
59 .Li (const char *)NULL ,
60 each entry is prefixed by this character string.
61 .Pp
62 If the argument
63 .Va options
64 is
65 .Li 0 ,
66 ACL entries are converted using the entry tag type keywords
67 .Li user , group , mask ,
68 and
69 .Li other .
70 User IDs and group IDs of ACL entries that contain such
71 qualifiers are converted to their corresponding names; if an identifier
72 has no corresponding name, a decimal number string is produced. The
73 ACL text representation contains no additional comments.
74 A bitwise combinations of the following
75 .Va options
76 can be used to modify the result:
77 .Bl -tag
78 .It TEXT_ABBREVIATE
79 Instead of the full tag type keywords, single letter abbreviations are used.
80 The abbreviation for
81 .Li user
82 is
83 .Li u ,
84 the abbreviation for
85 .Li group
86 is
87 .Li g ,
88 the abbreviation for
89 .Li mask
90 is
91 .Li m ,
92 and the abbreviation for
93 .Li other
94 is
95 .Li o .
96 .It TEXT_NUMERIC_IDS
97 User IDs and group IDs are included as decimal numbers instead of names.
98 .It TEXT_SOME_EFFECTIVE
99 A comment containing the effective permissions of the ACL entry is
100 included after ACL entries that contain permissions which are ineffective
101 because they are masked by an ACL_MASK entry. The ACL entry and the comment
102 are separated by a tab character.
103 .It TEXT_ALL_EFFECTIVE
104 A comment containing the effective permissions of the ACL entry is
105 included after all ACL entries that are affected by an ACL_MASK entry.
106 The comment is included even if the permissions contained in the ACL
107 entry equal the effective permissions. The ACL entry and the comment are
108 separated by a tab character.
109 .It TEXT_SMART_INDENT
110 This option is used in combination with the TEXT_SOME_EFFECTIVE or
111 TEXT_ALL_EFFECTIVE option. The number of tab characters inserted between
112 the ACL entry and the comment is increased so that the comment is
113 aligned to the fourth tab stop position.
114 A tab width of 8 characters is assumed.
115 .El
116 .Pp
117 The ACL referred to by
118 .Va acl
119 is not changed.
120 .Pp
121 This function allocates any memory necessary to contain the string and
122 returns a pointer to the string.  The caller should free any releasable
123 memory, when the new string is no longer required, by calling
124 .Fn acl_free
125 with the
126 .Va (void*)char
127 returned by
128 .Fn acl_to_any_text
129 as an argument.
130 .Sh RETURN VALUE
131 On success, this function returns a pointer to the text
132 representation of the ACL.  On error, a value of
133 .Li (char *)NULL
134 is returned, and
135 .Va errno
136 is set appropriately.
137 .Sh ERRORS
138 If any of the following conditions occur, the
139 .Fn acl_to_any_text
140 function returns a value of
141 .Li (char *)NULL
142 and sets
143 .Va errno
144 to the corresponding value:
145 .Bl -tag -width Er
146 .It Bq Er EINVAL
147 The argument
148 .Va acl
149 is not a valid pointer to an ACL.
150 .Pp
151 The ACL referenced by
152 .Va acl
153 contains one or more improperly formed ACL entries, or for some other
154 reason cannot be translated into the text form of an ACL.
155 .It Bq Er ENOMEM
156 The character string to be returned requires more memory than is allowed
157 by the hardware or system-imposed memory management constraints.
158 .El
159 .Sh STANDARDS
160 This is a non-portable, Linux specific extension to the ACL manipulation
161 functions defined in IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned).
162 .Sh SEE ALSO
163 .Xr acl_from_text 3 ,
164 .Xr acl_to_text 3 ,
165 .Xr acl_free 3 ,
166 .Xr acl 5
167 .Sh AUTHOR
168 Written by
169 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .