xref: /freebsd/lib/libc/posix1e/acl_set.3 (revision ca48e73a1887e639bf65e5e4d8aa462d86eccd6f)
1a889d1fbSRobert Watson.\"-
293724388SRobert Watson.\" Copyright (c) 2000, 2002 Robert N. M. Watson
3a889d1fbSRobert Watson.\" All rights reserved.
4a889d1fbSRobert Watson.\"
593724388SRobert Watson.\" This software was developed by Robert Watson for the TrustedBSD Project.
693724388SRobert 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.\"
30ca48e73aSEdward Tomasz Napierala.Dd June 25, 2009
31a889d1fbSRobert Watson.Dt ACL_SET 3
32a307d598SRuslan Ermilov.Os
33a889d1fbSRobert Watson.Sh NAME
34a889d1fbSRobert Watson.Nm acl_set_fd ,
35f75b050cSAlexey Zelkin.Nm acl_set_fd_np ,
3693724388SRobert Watson.Nm acl_set_file ,
3793724388SRobert Watson.Nm acl_set_link_np
3898a32f6dSChris D. Faulhaber.Nd set an ACL for a file
39f75b050cSAlexey Zelkin.Sh LIBRARY
4031acc836SRuslan Ermilov.Lb libc
41a889d1fbSRobert Watson.Sh SYNOPSIS
4232eef9aeSRuslan Ermilov.In sys/types.h
4332eef9aeSRuslan Ermilov.In sys/acl.h
44a889d1fbSRobert Watson.Ft int
45a889d1fbSRobert Watson.Fn acl_set_fd "int fd" "acl_t acl"
46a889d1fbSRobert Watson.Ft int
47a889d1fbSRobert Watson.Fn acl_set_fd_np "int fd" "acl_t acl" "acl_type_t type"
4893724388SRobert Watson.Ft int
4993724388SRobert Watson.Fn acl_set_file "const char *path_p" "acl_type_t type" "acl_t acl"
5093724388SRobert Watson.Ft int
5193724388SRobert Watson.Fn acl_set_link_np "const char *path_p" "acl_type_t type" "acl_t acl"
52a889d1fbSRobert Watson.Sh DESCRIPTION
53a889d1fbSRobert WatsonThe
54a889d1fbSRobert Watson.Fn acl_set_fd ,
5593724388SRobert Watson.Fn acl_set_fd_np ,
5693724388SRobert Watson.Fn acl_set_file ,
57a889d1fbSRobert Watsonand
5866d8bae4SRuslan Ermilov.Fn acl_set_link_np
59a889d1fbSRobert Watsoneach associate an ACL with an object referred to by
60a889d1fbSRobert Watson.Va fd
61a889d1fbSRobert Watsonor
62a889d1fbSRobert Watson.Va path_p .
63d6498251SPhilippe CharnierThe
64a889d1fbSRobert Watson.Fn acl_set_fd_np
6593724388SRobert Watsonand
6693724388SRobert Watson.Fn acl_set_link_np
67d6498251SPhilippe Charnierfunctions are not POSIX.1e calls.
68d6498251SPhilippe CharnierThe
69a889d1fbSRobert Watson.Fn acl_set_fd
70d6498251SPhilippe Charnierfunction allows only the setting of ACLs of type ACL_TYPE_ACCESS
71a889d1fbSRobert Watsonwhere as
72a889d1fbSRobert Watson.Fn acl_set_fd_np
73a889d1fbSRobert Watsonallows the setting of ACLs of any type.
74d6498251SPhilippe CharnierThe
7593724388SRobert Watson.Fn acl_set_link_np
76d6498251SPhilippe Charnierfunction acts on a symlink rather than its target, if the target of the
7793724388SRobert Watsonpath is a symlink.
78f24f1c51SEdward Tomasz Napierala.Pp
79f24f1c51SEdward Tomasz NapieralaValid values for the
80f24f1c51SEdward Tomasz Napierala.Va type
81f24f1c51SEdward Tomasz Napieralaargument are:
82f24f1c51SEdward Tomasz Napierala.Pp
83f24f1c51SEdward Tomasz Napierala.Bl -column -offset 3n "ACL_TYPE_DEFAULT"
84f24f1c51SEdward Tomasz Napierala.It ACL_TYPE_ACCESS	POSIX.1e access ACL
85f24f1c51SEdward Tomasz Napierala.It ACL_TYPE_DEFAULT	POSIX.1e default ACL
86aa015c8eSEdward Tomasz Napierala.It ACL_TYPE_NFS4	NFSv4 ACL
87f24f1c51SEdward Tomasz Napierala.El
88aa015c8eSEdward Tomasz Napierala.Pp
89aa015c8eSEdward Tomasz NapieralaTrying to set ACL_TYPE_NFS4 with
90aa015c8eSEdward Tomasz Napierala.Va acl
91aa015c8eSEdward Tomasz Napieralabranded as POSIX.1e, or ACL_TYPE_ACCESS or ACL_TYPE_DEFAULT with ACL
92aa015c8eSEdward Tomasz Napieralabranded as NFSv4, will result in error.
93a889d1fbSRobert Watson.Sh IMPLEMENTATION NOTES
94b5c508fbSRuslan Ermilov.Fx Ns 's
95b5c508fbSRuslan Ermilovsupport for POSIX.1e interfaces and features is still under
96a889d1fbSRobert Watsondevelopment at this time.
97a889d1fbSRobert Watson.Sh RETURN VALUES
98d6002fefSRuslan Ermilov.Rv -std
99a889d1fbSRobert Watson.Sh ERRORS
100a889d1fbSRobert WatsonIf any of the following conditions occur, these functions shall return
101a889d1fbSRobert Watson-1 and set
102a889d1fbSRobert Watson.Va errno
103a889d1fbSRobert Watsonto the corresponding value:
104a889d1fbSRobert Watson.Bl -tag -width Er
105a889d1fbSRobert Watson.It Bq Er EACCES
106a889d1fbSRobert WatsonSearch permission is denied for a component of the path prefix, or the
107a889d1fbSRobert Watsonobject exists and the process does not have appropriate access rights.
108a889d1fbSRobert Watson.It Bq Er EBADF
109a889d1fbSRobert WatsonThe
110a889d1fbSRobert Watson.Va fd
111a889d1fbSRobert Watsonargument is not a valid file descriptor.
112a889d1fbSRobert Watson.It Bq Er EINVAL
113a889d1fbSRobert WatsonArgument
114a889d1fbSRobert Watson.Va acl
115a889d1fbSRobert Watsondoes not point to a valid ACL for this object, or the ACL type
116a889d1fbSRobert Watsonspecified in
117a889d1fbSRobert Watson.Va type
118aa015c8eSEdward Tomasz Napieralais invalid for this object, or there is branding mismatch.
119a889d1fbSRobert Watson.It Bq Er ENAMETOOLONG
120a889d1fbSRobert WatsonA component of a pathname exceeded 255 characters, or an
121a889d1fbSRobert Watsonentire path name exceeded 1023 characters.
122a889d1fbSRobert Watson.It Bq Er ENOENT
123a889d1fbSRobert WatsonThe named object does not exist, or the
124a889d1fbSRobert Watson.Va path_p
125a889d1fbSRobert Watsonargument points to an empty string.
126a889d1fbSRobert Watson.It Bq Er ENOMEM
127a889d1fbSRobert WatsonInsufficient memory available to fulfill request.
128a889d1fbSRobert Watson.It Bq Er ENOSPC
129a889d1fbSRobert WatsonThe directory or file system that would contain the new ACL cannot be
130a889d1fbSRobert Watsonextended, or the file system is out of file allocation resources.
131a889d1fbSRobert Watson.It Bq Er EOPNOTSUPP
132a889d1fbSRobert WatsonThe file system does not support ACL retrieval.
133a889d1fbSRobert Watson.It Bq Er EROFS
134a889d1fbSRobert WatsonThis function requires modification of a file system which is currently
135a889d1fbSRobert Watsonread-only.
136a889d1fbSRobert Watson.El
137a889d1fbSRobert Watson.Sh SEE ALSO
138a889d1fbSRobert Watson.Xr acl 3 ,
139a889d1fbSRobert Watson.Xr acl_delete 3 ,
140a889d1fbSRobert Watson.Xr acl_get 3 ,
141aa015c8eSEdward Tomasz Napierala.Xr acl_get_brand_np 3 ,
142a889d1fbSRobert Watson.Xr acl_valid 3 ,
143a889d1fbSRobert Watson.Xr posix1e 3
144a889d1fbSRobert Watson.Sh STANDARDS
1451a0a9345SRuslan ErmilovPOSIX.1e is described in IEEE POSIX.1e draft 17.
1461a0a9345SRuslan ErmilovDiscussion
147a889d1fbSRobert Watsonof the draft continues on the cross-platform POSIX.1e implementation
1481a0a9345SRuslan Ermilovmailing list.
1491a0a9345SRuslan ErmilovTo join this list, see the
150c32381adSMike Pritchard.Fx
151c32381adSMike PritchardPOSIX.1e implementation
152a889d1fbSRobert Watsonpage for more information.
153a889d1fbSRobert Watson.Sh HISTORY
154c32381adSMike PritchardPOSIX.1e support was introduced in
155c32381adSMike Pritchard.Fx 4.0 ,
156c32381adSMike Pritchardand development continues.
157a889d1fbSRobert Watson.Sh AUTHORS
158c32381adSMike Pritchard.An Robert N M Watson
159