xref: /dragonfly/lib/libposix1e/acl_set.3 (revision f8f04fe3)
1.\"-
2.\" Copyright (c) 2000 Robert N. M. Watson
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD: src/lib/libposix1e/acl_set.3,v 1.2.2.5 2002/01/09 13:34:56 ru Exp $
27.\" $DragonFly: src/lib/libposix1e/acl_set.3,v 1.3 2004/03/11 12:28:52 hmp Exp $
28.\"
29.Dd January 28, 2000
30.Dt ACL_SET 3
31.Os
32.Sh NAME
33.Nm acl_set_fd ,
34.Nm acl_set_fd_np ,
35.Nm acl_set_file
36.Nd set an ACL for a file
37.Sh LIBRARY
38.Lb libposix1e
39.Sh SYNOPSIS
40.In sys/types.h
41.In sys/acl.h
42.Ft int
43.Fn acl_set_file "const char *path_p" "acl_type_t type" "acl_t acl"
44.Ft int
45.Fn acl_set_fd "int fd" "acl_t acl"
46.Ft int
47.Fn acl_set_fd_np "int fd" "acl_t acl" "acl_type_t type"
48.Sh DESCRIPTION
49The
50.Fn acl_set_file ,
51.Fn acl_set_fd ,
52and
53.Fn acl_set_fd_np
54each associate an ACL with an object referred to by
55.Va fd
56or
57.Va path_p .
58All except
59.Fn acl_set_fd_np
60are POSIX.1e calls--
61.Fn acl_set_fd
62allows only the setting of ACLs of type ACL_TYPE_ACCESS
63where as
64.Fn acl_set_fd_np
65allows the setting of ACLs of any type.
66.Sh IMPLEMENTATION NOTES
67.Dx Ns 's
68support for POSIX.1e interfaces and features is still under
69development at this time.
70.Sh RETURN VALUES
71.Rv -std
72.Sh ERRORS
73If any of the following conditions occur, these functions shall return
74-1 and set
75.Va errno
76to the corresponding value:
77.Bl -tag -width Er
78.It Bq Er EACCES
79Search permission is denied for a component of the path prefix, or the
80object exists and the process does not have appropriate access rights.
81.It Bq Er EBADF
82The
83.Va fd
84argument is not a valid file descriptor.
85.It Bq Er EINVAL
86Argument
87.Va acl
88does not point to a valid ACL for this object, or the ACL type
89specified in
90.Va type
91is invalid for this object, or both.
92.It Bq Er ENAMETOOLONG
93A component of a pathname exceeded 255 characters, or an
94entire path name exceeded 1023 characters.
95.It Bq Er ENOENT
96The named object does not exist, or the
97.Va path_p
98argument points to an empty string.
99.It Bq Er ENOMEM
100Insufficient memory available to fulfill request.
101.It Bq Er ENOSPC
102The directory or file system that would contain the new ACL cannot be
103extended, or the file system is out of file allocation resources.
104.It Bq Er EOPNOTSUPP
105The file system does not support ACL retrieval.
106.It Bq Er EROFS
107This function requires modification of a file system which is currently
108read-only.
109.El
110.Sh SEE ALSO
111.Xr acl 3 ,
112.Xr acl_delete 3 ,
113.Xr acl_get 3 ,
114.Xr acl_valid 3 ,
115.Xr posix1e 3
116.Sh STANDARDS
117POSIX.1e is described in IEEE POSIX.1e draft 17.  Discussion
118of the draft continues on the cross-platform POSIX.1e implementation
119mailing list.  To join this list, see the
120.Fx
121POSIX.1e implementation
122page for more information.
123.Sh HISTORY
124POSIX.1e support was introduced in
125.Fx 4.0 ,
126and development continues.
127.Sh AUTHORS
128.An Robert N M Watson
129.Sh BUGS
130These features are not yet fully implemented.  In particular, the shipped
131version of UFS/FFS does not support storage of additional security labels,
132and so is unable to (easily) provide support for most of these features.
133