xref: /netbsd-src/share/man/man9/VOP_SETACL.9 (revision 8dc77b19f847e92a07203a8f0f0c7eaa80dc426f)
1.\" $NetBSD: VOP_SETACL.9,v 1.2 2022/01/17 23:12:41 wiz Exp $
2.\"-
3.\" Copyright (c) 1999, 2000, 2001 Robert N. M. Watson
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD: head/share/man/man9/VOP_SETACL.9 235319 2012-05-12 03:46:43Z gjb $
28.\"
29.Dd January 17, 2022
30.Dt VOP_SETACL 9
31.Os
32.Sh NAME
33.Nm VOP_SETACL
34.Nd set the access control list for a vnode
35.Sh SYNOPSIS
36.In sys/param.h
37.In sys/vnode.h
38.In sys/acl.h
39.Ft int
40.Fn VOP_SETACL "struct vnode *vp" "acl_type_t type" "struct acl *aclp" "kauth_cred_t cred"
41.Sh DESCRIPTION
42This vnode call may be used to set the access control list (ACL) for a file
43or directory.
44.Pp
45Its arguments are:
46.Bl -tag -width type
47.It Fa vp
48The vnode of the file or directory.
49.It Fa type
50The type of ACL to set.
51.It Fa aclp
52A pointer to an ACL structure from which to retrieve the ACL data.
53.It Fa cred
54The user credentials to use in authorizing the request.
55.El
56.Pp
57The
58.Fa aclp
59pointer may be
60.Dv NULL
61to indicate that the specified ACL should be deleted.
62.Pp
63The
64.Fa cred
65pointer may be
66.Dv NULL
67to indicate that access control checks are not to be performed, if possible.
68This cred setting might be used to allow the kernel to authorize ACL
69changes that the active process might not be permitted to make.
70.Pp
71The vnode ACL interface defines the syntax, and not semantics, of file and
72directory ACL interfaces.
73More information about ACL management in kernel
74may be found in
75.Xr acl 9 .
76.Sh LOCKS
77The vnode will be locked on entry and should remain locked on return.
78.Sh RETURN VALUES
79If the ACL is successfully set, then zero is returned.
80Otherwise, an appropriate error code is returned.
81.Sh ERRORS
82.Bl -tag -width Er
83.It Bq Er EACCES
84The caller does not have the appropriate privilege.
85.It Bq Er EINVAL
86The ACL type passed is invalid for this vnode, or the ACL data is invalid.
87.It Bq Er ENOMEM
88Sufficient memory is not available to fulfill the request.
89.It Bq Er ENOSPC
90The file system is out of space.
91.It Bq Er EOPNOTSUPP
92The file system does not support
93.Fn VOP_SETACL .
94.It Bq Er EROFS
95The file system is read-only.
96.El
97.Sh SEE ALSO
98.Xr acl 9 ,
99.Xr vnode 9 ,
100.Xr VOP_ACLCHECK 9 ,
101.Xr VOP_GETACL 9
102.Sh AUTHORS
103This manual page was written by
104.An Robert Watson .
105