xref: /freebsd/lib/libc/posix1e/acl_from_text.3 (revision 1a0a934547909744a6a2fa4cfd5b795ec6394f05)
1a889d1fbSRobert Watson.\"-
2e4c3e988SRobert Watson.\" Copyright (c) 2000, 2002 Robert N. M. Watson
3a889d1fbSRobert Watson.\" All rights reserved.
4a889d1fbSRobert Watson.\"
5e4c3e988SRobert Watson.\" This software was developed by Robert Watson for the TrustedBSD Project.
6e4c3e988SRobert Watson.\"
7a889d1fbSRobert Watson.\" Redistribution and use in source and binary forms, with or without
8a889d1fbSRobert Watson.\" modification, are permitted provided that the following conditions
9a889d1fbSRobert Watson.\" are met:
10a889d1fbSRobert Watson.\" 1. Redistributions of source code must retain the above copyright
11a889d1fbSRobert Watson.\"    notice, this list of conditions and the following disclaimer.
12a889d1fbSRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright
13a889d1fbSRobert Watson.\"    notice, this list of conditions and the following disclaimer in the
14a889d1fbSRobert Watson.\"    documentation and/or other materials provided with the distribution.
15a889d1fbSRobert Watson.\"
16a889d1fbSRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17a889d1fbSRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18a889d1fbSRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19a889d1fbSRobert Watson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20a889d1fbSRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21a889d1fbSRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22a889d1fbSRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23a889d1fbSRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24a889d1fbSRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25a889d1fbSRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26a889d1fbSRobert Watson.\" SUCH DAMAGE.
27a889d1fbSRobert Watson.\"
28a889d1fbSRobert Watson.\" $FreeBSD$
29a889d1fbSRobert Watson.\"
30a889d1fbSRobert Watson.Dd January 28, 2000
31a889d1fbSRobert Watson.Dt ACL_FROM_TEXT 3
32a307d598SRuslan Ermilov.Os
33a889d1fbSRobert Watson.Sh NAME
34a889d1fbSRobert Watson.Nm acl_from_text
35f75b050cSAlexey Zelkin.Nd create an ACL from text
36f75b050cSAlexey Zelkin.Sh LIBRARY
3731acc836SRuslan Ermilov.Lb libc
38a889d1fbSRobert Watson.Sh SYNOPSIS
3932eef9aeSRuslan Ermilov.In sys/types.h
4032eef9aeSRuslan Ermilov.In sys/acl.h
4197d186bcSBruce Evans.Ft acl_t
42a889d1fbSRobert Watson.Fn acl_from_text "const char *buf_p"
43a889d1fbSRobert Watson.Sh DESCRIPTION
44a889d1fbSRobert WatsonThe
45a889d1fbSRobert Watson.Fn acl_from_text
46a889d1fbSRobert Watsonfunction converts the text form of an ACL referred to by
47a889d1fbSRobert Watson.Va buf_p
48a889d1fbSRobert Watsoninto the internal working structure for ACLs, appropriate for applying to
49a889d1fbSRobert Watsonfiles or manipulating.
5042635956SRuslan Ermilov.Pp
511a0a9345SRuslan ErmilovThis function may cause memory to be allocated.
521a0a9345SRuslan ErmilovThe caller should free any
53a889d1fbSRobert Watsonreleasable memory, when the new ACL is no longer required, by calling
54a889d1fbSRobert Watson.Xr acl_free 3
55a889d1fbSRobert Watsonwith the
56a889d1fbSRobert Watson.Va (void *)acl_t
57a889d1fbSRobert Watsonas an argument.
58a889d1fbSRobert Watson.Sh IMPLEMENTATION NOTES
59b5c508fbSRuslan Ermilov.Fx Ns 's
60b5c508fbSRuslan Ermilovsupport for POSIX.1e interfaces and features is still under
61a889d1fbSRobert Watsondevelopment at this time.
62a889d1fbSRobert Watson.Sh RETURN VALUES
63a889d1fbSRobert WatsonUpon successful completion, the function shall return a pointer to the
641a0a9345SRuslan Ermilovinternal representation of the ACL in working storage.
651a0a9345SRuslan ErmilovOtherwise, a value
66a889d1fbSRobert Watsonof
67a889d1fbSRobert Watson.Va (acl_t)NULL
68a889d1fbSRobert Watsonshall be returned, and
69a889d1fbSRobert Watson.Va errno
70a889d1fbSRobert Watsonshall be set to indicate the error.
71a889d1fbSRobert Watson.Sh ERRORS
72a889d1fbSRobert WatsonIf any of the following conditions occur, the
73a889d1fbSRobert Watson.Fn acl_from_text
74a889d1fbSRobert Watsonfunction shall return a value of
75a889d1fbSRobert Watson.Va (acl_t)NULL
76a889d1fbSRobert Watsonand set
77a889d1fbSRobert Watson.Va errno
78a889d1fbSRobert Watsonto the corresponding value:
79a889d1fbSRobert Watson.Bl -tag -width Er
80a889d1fbSRobert Watson.It Bq Er EINVAL
81a889d1fbSRobert WatsonArgument
82a889d1fbSRobert Watson.Va buf_p
83a889d1fbSRobert Watsoncannot be translated into an ACL.
84a889d1fbSRobert Watson.It Bq Er ENOMEM
85a889d1fbSRobert WatsonThe ACL working storage requires more memory than is allowed by the
86a889d1fbSRobert Watsonhardware or system-imposed memory management constraints.
87a889d1fbSRobert Watson.El
88a889d1fbSRobert Watson.Sh SEE ALSO
89a889d1fbSRobert Watson.Xr acl 3 ,
90a889d1fbSRobert Watson.Xr acl_free 3 ,
91a889d1fbSRobert Watson.Xr acl_get 3 ,
92a889d1fbSRobert Watson.Xr acl_to_text 3 ,
93a889d1fbSRobert Watson.Xr posix1e 3
94a889d1fbSRobert Watson.Sh STANDARDS
951a0a9345SRuslan ErmilovPOSIX.1e is described in IEEE POSIX.1e draft 17.
961a0a9345SRuslan ErmilovDiscussion
97a889d1fbSRobert Watsonof the draft continues on the cross-platform POSIX.1e implementation
981a0a9345SRuslan Ermilovmailing list.
991a0a9345SRuslan ErmilovTo join this list, see the
100c32381adSMike Pritchard.Fx
101c32381adSMike PritchardPOSIX.1e implementation
102a889d1fbSRobert Watsonpage for more information.
103a889d1fbSRobert Watson.Sh HISTORY
104c32381adSMike PritchardPOSIX.1e support was introduced in
105c32381adSMike Pritchard.Fx 4.0 ,
106c32381adSMike Pritchardand development continues.
107a889d1fbSRobert Watson.Sh AUTHORS
108c32381adSMike Pritchard.An Robert N M Watson
109a889d1fbSRobert Watson.Sh BUGS
1101fae73b1SRuslan ErmilovThe
111a889d1fbSRobert Watson.Fn acl_from_text
112a889d1fbSRobert Watsonand
113a889d1fbSRobert Watson.Fn acl_to_text
1141fae73b1SRuslan Ermilovfunctions
115a889d1fbSRobert Watsonrely on the
116a889d1fbSRobert Watson.Xr getpwent 3
117a889d1fbSRobert Watsonlibrary calls to manage username and uid mapping, as well as the
118a889d1fbSRobert Watson.Xr getgrent 3
1191a0a9345SRuslan Ermilovlibrary calls to manage groupname and gid mapping.
1201a0a9345SRuslan ErmilovThese calls are not
121a889d1fbSRobert Watsonthread safe, and so transitively, neither are
122a889d1fbSRobert Watson.Fn acl_from_text
123a889d1fbSRobert Watsonand
124a889d1fbSRobert Watson.Fn acl_to_text .
125a889d1fbSRobert WatsonThese functions may also interfere with stateful
126a889d1fbSRobert Watsoncalls associated with the
127a889d1fbSRobert Watson.Fn getpwent
128a889d1fbSRobert Watsonand
129a889d1fbSRobert Watson.Fn getgrent
130a889d1fbSRobert Watsoncalls.
131