xref: /freebsd/share/man/man9/acl.9 (revision 6fe89339b9618713289aeea1be27fe9a287cd07f)
132900e82SRobert Watson.\"-
2ca7d2b82SRobert Watson.\" Copyright (c) 1999, 2000 Robert N. M. Watson
332900e82SRobert Watson.\" All rights reserved.
432900e82SRobert Watson.\"
532900e82SRobert Watson.\" Redistribution and use in source and binary forms, with or without
632900e82SRobert Watson.\" modification, are permitted provided that the following conditions
732900e82SRobert Watson.\" are met:
832900e82SRobert Watson.\" 1. Redistributions of source code must retain the above copyright
932900e82SRobert Watson.\"    notice, this list of conditions and the following disclaimer.
1032900e82SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright
1132900e82SRobert Watson.\"    notice, this list of conditions and the following disclaimer in the
1232900e82SRobert Watson.\"    documentation and/or other materials provided with the distribution.
1332900e82SRobert Watson.\"
1432900e82SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1532900e82SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1632900e82SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1732900e82SRobert Watson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1832900e82SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1932900e82SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2032900e82SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2132900e82SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2232900e82SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2332900e82SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2432900e82SRobert Watson.\" SUCH DAMAGE.
2532900e82SRobert Watson.\"
2632900e82SRobert Watson.\"       $FreeBSD$
2732900e82SRobert Watson.\"
2832900e82SRobert Watson.Dd December 23, 1999
2932900e82SRobert Watson.Os
3032900e82SRobert Watson.Dt ACL 9
3132900e82SRobert Watson.Sh NAME
3232900e82SRobert Watson.Nm acl
3332900e82SRobert Watson.Nd virtual file system access control lists
3432900e82SRobert Watson.Sh SYNOPSIS
3532900e82SRobert Watson.Fd #include <sys/param.h>
3632900e82SRobert Watson.Fd #include <sys/vnode.h>
3732900e82SRobert Watson.Fd #include <sys/acl.h>
3832900e82SRobert Watson.Pp
3932900e82SRobert Watson.Bd -literal
4032900e82SRobert Watsontypedef int     acl_type_t;
4132900e82SRobert Watsontypedef int     acl_tag_t;
4232900e82SRobert Watsontypedef mode_t  acl_perm_t;
4332900e82SRobert Watson
4432900e82SRobert Watsonstruct acl_entry {
4532900e82SRobert Watson        acl_tag_t       ae_tag;
4632900e82SRobert Watson        uid_t           ae_id;
4732900e82SRobert Watson        acl_perm_t      ae_perm;
4832900e82SRobert Watson};
4932900e82SRobert Watsontypedef struct acl_entry        *acl_entry_t;
5032900e82SRobert Watson
5132900e82SRobert Watsonstruct acl {
5232900e82SRobert Watson        int                     acl_cnt;
53ca7d2b82SRobert Watson        struct acl_entry        acl_entry[ACL_MAX_ENTRIES];
5432900e82SRobert Watson};
5532900e82SRobert Watsontypedef struct acl      *acl_t;
5632900e82SRobert Watson
5732900e82SRobert Watson/*
58ca7d2b82SRobert Watson * Possible valid values for a_tag of acl_entry_t
5932900e82SRobert Watson */
6032900e82SRobert Watson#define ACL_USER_OBJ    0x00000001
6132900e82SRobert Watson#define ACL_USER        0x00000002
6232900e82SRobert Watson#define ACL_GROUP_OBJ   0x00000004
6332900e82SRobert Watson#define ACL_GROUP       0x00000008
6432900e82SRobert Watson#define ACL_MASK        0x00000010
6532900e82SRobert Watson#define ACL_OTHER       0x00000020
6632900e82SRobert Watson#define ACL_OTHER_OBJ   ACL_OTHER
6732900e82SRobert Watson
68ca7d2b82SRobert Watson/*
69ca7d2b82SRobert Watson * Possible valid values a_type_t arguments
70ca7d2b82SRobert Watson */
7132900e82SRobert Watson#define ACL_TYPE_ACCESS         0x00000000
7232900e82SRobert Watson#define ACL_TYPE_DEFAULT        0x00000001
73ca7d2b82SRobert Watson#define ACL_TYPE_AFS            0x00000002
74ca7d2b82SRobert Watson#define ACL_TYPE_CODA           0x00000003
75ca7d2b82SRobert Watson#define ACL_TYPE_NTFS           0x00000004
76ca7d2b82SRobert Watson#define ACL_TYPE_NWFS           0x00000005
7732900e82SRobert Watson
7832900e82SRobert Watson/*
7932900e82SRobert Watson * Possible flags in a_perm field
8032900e82SRobert Watson */
8132900e82SRobert Watson#define ACL_PERM_EXEC           0x0001
8232900e82SRobert Watson#define ACL_PERM_WRITE          0x0002
8332900e82SRobert Watson#define ACL_PERM_READ           0x0004
8432900e82SRobert Watson#define ACL_PERM_NONE           0x0000
8532900e82SRobert Watson#define ACL_PERM_BITS           (ACL_PERM_EXEC | ACL_PERM_WRITE | ACL_PERM_READ)
8632900e82SRobert Watson#define ACL_POSIX1E_BITS        (ACL_PERM_EXEC | ACL_PERM_WRITE | ACL_PERM_READ)
8732900e82SRobert Watson.Ed
8832900e82SRobert Watson.Sh DESCRIPTION
8932900e82SRobert WatsonAccess control lists, or ACLs, allow fine-grained specification of rights
9032900e82SRobert Watsonfor vnodes representing files and directories.  However, as there are a
9132900e82SRobert Watsonplethora of file systems with differing ACL semantics, the vnode interface
9232900e82SRobert Watsonis aware only of the syntax of ACLs, relying on the underlying file system
9332900e82SRobert Watsonto implement the details.  Depending on the underlying file system, each
9432900e82SRobert Watsonfile or directory may have zero or more ACLs associated with it, named using
9532900e82SRobert Watsonthe
9632900e82SRobert Watson.Fa type
9732900e82SRobert Watsonfield of the appropriate vnode ACL calls,
9832900e82SRobert Watson.Xr VOP_ACLCHECK 9 ,
9932900e82SRobert Watson.Xr VOP_GETACL 9 ,
10032900e82SRobert Watsonand
10132900e82SRobert Watson.Xr VOP_SETACL 9 .
10232900e82SRobert Watson
10332900e82SRobert WatsonCurrently, each ACL is represented in-kernel by a fixed-size acl structure.
10432900e82SRobert WatsonAn ACL is constructed from a fixed size array of ACL entries, each of which
10532900e82SRobert Watsonconsists of a set of permissions, principal namespace, and principal
10632900e82SRobert Watsonidentifier.  Zero or more of these entries may be "defined", depending on
10732900e82SRobert Watsonthe value of the associated acl_cnt field.
10832900e82SRobert Watson.Sh SEE ALSO
10932900e82SRobert Watson.Xr VFS 9 ,
11032900e82SRobert Watson.Xr VOP_ACLCHECK 9 ,
11132900e82SRobert Watson.Xr VOP_GETACL 9 ,
1126fe89339SBen Smithurst.Xr VOP_SETACL 9
11332900e82SRobert Watson.Sh AUTHORS
11432900e82SRobert WatsonThis man page was written by
11532900e82SRobert Watson.An Robert Watson .
116