xref: /netbsd-src/lib/libc/posix1e/acl_from_text.3 (revision 1b3734281f17fd86d3db0e29f84ea9985be6fe06)
1.\" $NetBSD: acl_from_text.3,v 1.2 2020/06/18 19:46:34 wiz Exp $
2.\"-
3.\" Copyright (c) 2000, 2002 Robert N. M. Watson
4.\" All rights reserved.
5.\"
6.\" This software was developed by Robert Watson for the TrustedBSD Project.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\" $FreeBSD: head/lib/libc/posix1e/acl_from_text.3 131504 2004-07-02 23:52:20Z ru $
30.\"
31.Dd January 28, 2000
32.Dt ACL_FROM_TEXT 3
33.Os
34.Sh NAME
35.Nm acl_from_text
36.Nd create an ACL from text
37.Sh LIBRARY
38.Lb libc
39.Sh SYNOPSIS
40.In sys/types.h
41.In sys/acl.h
42.Ft acl_t
43.Fn acl_from_text "const char *buf_p"
44.Sh DESCRIPTION
45The
46.Fn acl_from_text
47function converts the text form of an ACL referred to by
48.Va buf_p
49into the internal working structure for ACLs, appropriate for applying to
50files or manipulating.
51.Pp
52This function may cause memory to be allocated.
53The caller should free any
54releasable memory, when the new ACL is no longer required, by calling
55.Xr acl_free 3
56with the
57.Va (void *)acl_t
58as an argument.
59.Sh IMPLEMENTATION NOTES
60.Fx Ns 's
61support for POSIX.1e interfaces and features is still under
62development at this time.
63.Sh RETURN VALUES
64Upon successful completion, the function shall return a pointer to the
65internal representation of the ACL in working storage.
66Otherwise, a value
67of
68.Va (acl_t)NULL
69shall be returned, and
70.Va errno
71shall be set to indicate the error.
72.Sh ERRORS
73If any of the following conditions occur, the
74.Fn acl_from_text
75function shall return a value of
76.Va (acl_t)NULL
77and set
78.Va errno
79to the corresponding value:
80.Bl -tag -width Er
81.It Bq Er EINVAL
82Argument
83.Va buf_p
84cannot be translated into an ACL.
85.It Bq Er ENOMEM
86The ACL working storage requires more memory than is allowed by the
87hardware or system-imposed memory management constraints.
88.El
89.Sh SEE ALSO
90.Xr acl 3 ,
91.Xr acl_free 3 ,
92.Xr acl_get 3 ,
93.Xr acl_to_text 3 ,
94.Xr posix1e 3
95.Sh STANDARDS
96POSIX.1e is described in IEEE POSIX.1e draft 17.
97Discussion
98of the draft continues on the cross-platform POSIX.1e implementation
99mailing list.
100To join this list, see the
101.Fx
102POSIX.1e implementation
103page for more information.
104.Sh HISTORY
105POSIX.1e support was introduced in
106.Fx 4.0 ,
107and development continues.
108.Sh AUTHORS
109.An Robert N M Watson
110.Sh BUGS
111The
112.Fn acl_from_text
113and
114.Fn acl_to_text
115functions
116rely on the
117.Xr getpwent 3
118library calls to manage username and uid mapping, as well as the
119.Xr getgrent 3
120library calls to manage groupname and gid mapping.
121These calls are not
122thread safe, and so transitively, neither are
123.Fn acl_from_text
124and
125.Fn acl_to_text .
126These functions may also interfere with stateful
127calls associated with the
128.Fn getpwent
129and
130.Fn getgrent
131calls.
132