xref: /freebsd/lib/libc/posix1e/acl_set.3 (revision 31acc83627d4a9d59a4a9d2ec15c2be96f806112)
1a889d1fbSRobert Watson.\"-
2a889d1fbSRobert Watson.\" Copyright (c) 2000 Robert N. M. Watson
3a889d1fbSRobert Watson.\" All rights reserved.
4a889d1fbSRobert Watson.\"
5a889d1fbSRobert Watson.\" Redistribution and use in source and binary forms, with or without
6a889d1fbSRobert Watson.\" modification, are permitted provided that the following conditions
7a889d1fbSRobert Watson.\" are met:
8a889d1fbSRobert Watson.\" 1. Redistributions of source code must retain the above copyright
9a889d1fbSRobert Watson.\"    notice, this list of conditions and the following disclaimer.
10a889d1fbSRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright
11a889d1fbSRobert Watson.\"    notice, this list of conditions and the following disclaimer in the
12a889d1fbSRobert Watson.\"    documentation and/or other materials provided with the distribution.
13a889d1fbSRobert Watson.\"
14a889d1fbSRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15a889d1fbSRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16a889d1fbSRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17a889d1fbSRobert Watson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18a889d1fbSRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19a889d1fbSRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20a889d1fbSRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21a889d1fbSRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22a889d1fbSRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23a889d1fbSRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24a889d1fbSRobert Watson.\" SUCH DAMAGE.
25a889d1fbSRobert Watson.\"
26a889d1fbSRobert Watson.\" $FreeBSD$
27a889d1fbSRobert Watson.\"
28a889d1fbSRobert Watson.Dd January 28, 2000
29a889d1fbSRobert Watson.Dt ACL_SET 3
30ed403116SRuslan Ermilov.Os FreeBSD
31a889d1fbSRobert Watson.Sh NAME
32a889d1fbSRobert Watson.Nm acl_set_fd ,
33f75b050cSAlexey Zelkin.Nm acl_set_fd_np ,
34f75b050cSAlexey Zelkin.Nm acl_set_file
35f75b050cSAlexey Zelkin.Nd get an ACL for a file
36f75b050cSAlexey Zelkin.Sh LIBRARY
3731acc836SRuslan Ermilov.Lb libc
38a889d1fbSRobert Watson.Sh SYNOPSIS
39a889d1fbSRobert Watson.Fd #include <sys/types.h>
40a889d1fbSRobert Watson.Fd #include <sys/acl.h>
41a889d1fbSRobert Watson.Ft int
42a889d1fbSRobert Watson.Fn acl_set_file "const char *path_p" "acl_type_t type" "acl_t acl"
43a889d1fbSRobert Watson.Ft int
44a889d1fbSRobert Watson.Fn acl_set_fd "int fd" "acl_t acl"
45a889d1fbSRobert Watson.Ft int
46a889d1fbSRobert Watson.Fn acl_set_fd_np "int fd" "acl_t acl" "acl_type_t type"
47a889d1fbSRobert Watson.Sh DESCRIPTION
48a889d1fbSRobert WatsonThe
49a889d1fbSRobert Watson.Fn acl_set_file ,
50a889d1fbSRobert Watson.Fn acl_set_fd ,
51a889d1fbSRobert Watsonand
52a889d1fbSRobert Watson.Fn acl_set_fd_np
53a889d1fbSRobert Watsoneach associate an ACL with an object referred to by
54a889d1fbSRobert Watson.Va fd
55a889d1fbSRobert Watsonor
56a889d1fbSRobert Watson.Va path_p .
57a889d1fbSRobert WatsonAll except
58a889d1fbSRobert Watson.Fn acl_set_fd_np
59a889d1fbSRobert Watsonare POSIX.1e calls--
60a889d1fbSRobert Watson.Fn acl_set_fd
61a889d1fbSRobert Watsonallows only the setting of ACLs of type ACL_TYPE_ACCESS
62a889d1fbSRobert Watsonwhere as
63a889d1fbSRobert Watson.Fn acl_set_fd_np
64a889d1fbSRobert Watsonallows the setting of ACLs of any type.
65a889d1fbSRobert Watson.Sh IMPLEMENTATION NOTES
66b5c508fbSRuslan Ermilov.Fx Ns 's
67b5c508fbSRuslan Ermilovsupport for POSIX.1e interfaces and features is still under
68a889d1fbSRobert Watsondevelopment at this time.
69a889d1fbSRobert Watson.Sh RETURN VALUES
70c32381adSMike PritchardUpon successful completion, the function shall return a value of zero.
71a889d1fbSRobert WatsonOtherwise, a value of -1 shall be returned and
72a889d1fbSRobert Watson.Va errno
73a889d1fbSRobert Watsonshall be set to indicate the error.
74a889d1fbSRobert Watson.Sh ERRORS
75a889d1fbSRobert WatsonIf any of the following conditions occur, these functions shall return
76a889d1fbSRobert Watson-1 and set
77a889d1fbSRobert Watson.Va errno
78a889d1fbSRobert Watsonto the corresponding value:
79a889d1fbSRobert Watson.Bl -tag -width Er
80a889d1fbSRobert Watson.It Bq Er EACCES
81a889d1fbSRobert WatsonSearch permission is denied for a component of the path prefix, or the
82a889d1fbSRobert Watsonobject exists and the process does not have appropriate access rights.
83a889d1fbSRobert Watson.It Bq Er EBADF
84a889d1fbSRobert WatsonThe
85a889d1fbSRobert Watson.Va fd
86a889d1fbSRobert Watsonargument is not a valid file descriptor.
87a889d1fbSRobert Watson.It Bq Er EINVAL
88a889d1fbSRobert WatsonArgument
89a889d1fbSRobert Watson.Va acl
90a889d1fbSRobert Watsondoes not point to a valid ACL for this object, or the ACL type
91a889d1fbSRobert Watsonspecified in
92a889d1fbSRobert Watson.Va type
93a889d1fbSRobert Watsonis invalid for this object, or both.
94a889d1fbSRobert Watson.It Bq Er ENAMETOOLONG
95a889d1fbSRobert WatsonA component of a pathname exceeded 255 characters, or an
96a889d1fbSRobert Watsonentire path name exceeded 1023 characters.
97a889d1fbSRobert Watson.It Bq Er ENOENT
98a889d1fbSRobert WatsonThe named object does not exist, or the
99a889d1fbSRobert Watson.Va path_p
100a889d1fbSRobert Watsonargument points to an empty string.
101a889d1fbSRobert Watson.It Bq Er ENOMEM
102a889d1fbSRobert WatsonInsufficient memory available to fulfill request.
103a889d1fbSRobert Watson.It Bq Er ENOSPC
104a889d1fbSRobert WatsonThe directory or file system that would contain the new ACL cannot be
105a889d1fbSRobert Watsonextended, or the file system is out of file allocation resources.
106a889d1fbSRobert Watson.It Bq Er EOPNOTSUPP
107a889d1fbSRobert WatsonThe file system does not support ACL retrieval.
108a889d1fbSRobert Watson.It Bq Er EROFS
109a889d1fbSRobert WatsonThis function requires modification of a file system which is currently
110a889d1fbSRobert Watsonread-only.
111a889d1fbSRobert Watson.El
112a889d1fbSRobert Watson.Sh SEE ALSO
113a889d1fbSRobert Watson.Xr acl 3 ,
114a889d1fbSRobert Watson.Xr acl_delete 3 ,
115a889d1fbSRobert Watson.Xr acl_get 3 ,
116a889d1fbSRobert Watson.Xr acl_valid 3 ,
117a889d1fbSRobert Watson.Xr posix1e 3
118a889d1fbSRobert Watson.Sh STANDARDS
119a889d1fbSRobert WatsonPOSIX.1e is described in IEEE POSIX.1e draft 17.  Discussion
120a889d1fbSRobert Watsonof the draft continues on the cross-platform POSIX.1e implementation
121c32381adSMike Pritchardmailing list.  To join this list, see the
122c32381adSMike Pritchard.Fx
123c32381adSMike PritchardPOSIX.1e implementation
124a889d1fbSRobert Watsonpage for more information.
125a889d1fbSRobert Watson.Sh HISTORY
126c32381adSMike PritchardPOSIX.1e support was introduced in
127c32381adSMike Pritchard.Fx 4.0 ,
128c32381adSMike Pritchardand development continues.
129a889d1fbSRobert Watson.Sh AUTHORS
130c32381adSMike Pritchard.An Robert N M Watson
131a889d1fbSRobert Watson.Sh BUGS
132f4286d47SRobert WatsonThese features are not yet fully implemented.
133