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$ 27.\" 28.Dd January 28, 2000 29.Dt ACL_SET 3 30.Os FreeBSD 4.0 31.Sh NAME 32.Fd int 33.Nm acl_set_file , 34.Nm acl_set_fd , 35.Nm acl_set_fd_np 36.Nd Get an ACL for a file 37.Sh SYNOPSIS 38.Fd #include <sys/types.h> 39.Fd #include <sys/acl.h> 40.Ft int 41.Fn acl_set_file "const char *path_p" "acl_type_t type" "acl_t acl" 42.Ft int 43.Fn acl_set_fd "int fd" "acl_t acl" 44.Ft int 45.Fn acl_set_fd_np "int fd" "acl_t acl" "acl_type_t type" 46.Sh DESCRIPTION 47The 48.Fn acl_set_file , 49.Fn acl_set_fd , 50and 51.Fn acl_set_fd_np 52each associate an ACL with an object referred to by 53.Va fd 54or 55.Va path_p . 56All except 57.Fn acl_set_fd_np 58are POSIX.1e calls-- 59.Fn acl_set_fd 60allows only the setting of ACLs of type ACL_TYPE_ACCESS 61where as 62.Fn acl_set_fd_np 63allows the setting of ACLs of any type. 64.Sh IMPLEMENTATION NOTES 65FreeBSD's support for POSIX.1e interfaces and features is still under 66development at this time. 67.Sh RETURN VALUES 68Upon successfull completion, the function shall return a value of zero. 69Otherwise, a value of -1 shall be returned and 70.Va errno 71shall be set to indicate the error. 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 FreeBSD POSIX.1e implementation 120page for more information. 121.Sh HISTORY 122POSIX.1e support was introduced in FreeBSD 4.0, and development continues. 123.Sh AUTHORS 124Robert N M Watson 125.Sh BUGS 126These features are not yet fully implemented. In particular, the shipped 127version of UFS/FFS does not support storage of additional security labels, 128and so is unable to (easily) provide support for most of these features. 129