xref: /freebsd/share/man/man9/VOP_SETACL.9 (revision 61e21613)
1.\"-
2.\" Copyright (c) 1999, 2000, 2001 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.Dd December 23, 1999
27.Dt VOP_SETACL 9
28.Os
29.Sh NAME
30.Nm VOP_SETACL
31.Nd set the access control list for a vnode
32.Sh SYNOPSIS
33.In sys/param.h
34.In sys/vnode.h
35.In sys/acl.h
36.Ft int
37.Fn VOP_SETACL "struct vnode *vp" "acl_type_t type" "struct acl *aclp" "struct ucred *cred" "struct thread *td"
38.Sh DESCRIPTION
39This vnode call may be used to set the access control list (ACL) for a file
40or directory.
41.Pp
42Its arguments are:
43.Bl -tag -width type
44.It Fa vp
45The vnode of the file or directory.
46.It Fa type
47The type of ACL to set.
48.It Fa aclp
49A pointer to an ACL structure from which to retrieve the ACL data.
50.It Fa cred
51The user credentials to use in authorizing the request.
52.It Fa td
53The thread setting the ACL.
54.El
55.Pp
56The
57.Fa aclp
58pointer may be
59.Dv NULL
60to indicate that the specified ACL should be deleted.
61.Pp
62The
63.Fa cred
64pointer may be
65.Dv NULL
66to indicate that access control checks are not to be performed, if possible.
67This cred setting might be used to allow the kernel to authorize ACL
68changes that the active process might not be permitted to make.
69.Pp
70The vnode ACL interface defines the syntax, and not semantics, of file and
71directory ACL interfaces.
72More information about ACL management in kernel
73may be found in
74.Xr acl 9 .
75.Sh LOCKS
76The vnode will be locked on entry and should remain locked on return.
77.Sh RETURN VALUES
78If the ACL is successfully set, then zero is returned.
79Otherwise, an appropriate error code is returned.
80.Sh ERRORS
81.Bl -tag -width Er
82.It Bq Er EINVAL
83The ACL type passed is invalid for this vnode, or the ACL data is invalid.
84.It Bq Er EACCES
85The caller does not have the appropriate privilege.
86.It Bq Er ENOMEM
87Sufficient memory is not available to fulfill the request.
88.It Bq Er EOPNOTSUPP
89The file system does not support
90.Fn VOP_SETACL .
91.It Bq Er ENOSPC
92The file system is out of space.
93.It Bq Er EROFS
94The file system is read-only.
95.El
96.Sh SEE ALSO
97.Xr acl 9 ,
98.Xr vnode 9 ,
99.Xr VOP_ACLCHECK 9 ,
100.Xr VOP_GETACL 9
101.Sh AUTHORS
102This manual page was written by
103.An Robert Watson .
104