xref: /freebsd/lib/libc/posix1e/acl_add_perm.3 (revision 288eac5aed4763321c47fe21243fd384c804a313)
14bf60dfaSChris D. Faulhaber.\"-
24bf60dfaSChris D. Faulhaber.\" Copyright (c) 2001 Chris D. Faulhaber
34bf60dfaSChris D. Faulhaber.\" All rights reserved.
44bf60dfaSChris D. Faulhaber.\"
54bf60dfaSChris D. Faulhaber.\" Redistribution and use in source and binary forms, with or without
64bf60dfaSChris D. Faulhaber.\" modification, are permitted provided that the following conditions
74bf60dfaSChris D. Faulhaber.\" are met:
84bf60dfaSChris D. Faulhaber.\" 1. Redistributions of source code must retain the above copyright
94bf60dfaSChris D. Faulhaber.\"    notice, this list of conditions and the following disclaimer.
104bf60dfaSChris D. Faulhaber.\" 2. Redistributions in binary form must reproduce the above copyright
114bf60dfaSChris D. Faulhaber.\"    notice, this list of conditions and the following disclaimer in the
124bf60dfaSChris D. Faulhaber.\"    documentation and/or other materials provided with the distribution.
134bf60dfaSChris D. Faulhaber.\"
144bf60dfaSChris D. Faulhaber.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
154bf60dfaSChris D. Faulhaber.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
164bf60dfaSChris D. Faulhaber.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1768b23992SWarner Losh.\" ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
1868b23992SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1968b23992SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2068b23992SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2168b23992SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2268b23992SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2368b23992SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2468b23992SWarner Losh.\" SUCH DAMAGE.
254bf60dfaSChris D. Faulhaber.\"
264bf60dfaSChris D. Faulhaber.\" $FreeBSD$
274bf60dfaSChris D. Faulhaber.\"
28ca48e73aSEdward Tomasz Napierala.Dd June 25, 2009
294bf60dfaSChris D. Faulhaber.Dt ACL_ADD_PERM 3
304bf60dfaSChris D. Faulhaber.Os
314bf60dfaSChris D. Faulhaber.Sh NAME
324bf60dfaSChris D. Faulhaber.Nm acl_add_perm
338480a1ebSRuslan Ermilov.Nd add permissions to a permission set
344bf60dfaSChris D. Faulhaber.Sh LIBRARY
3531acc836SRuslan Ermilov.Lb libc
364bf60dfaSChris D. Faulhaber.Sh SYNOPSIS
3732eef9aeSRuslan Ermilov.In sys/types.h
3832eef9aeSRuslan Ermilov.In sys/acl.h
394bf60dfaSChris D. Faulhaber.Ft int
408480a1ebSRuslan Ermilov.Fn acl_add_perm "acl_permset_t permset_d" "acl_perm_t perm"
414bf60dfaSChris D. Faulhaber.Sh DESCRIPTION
421fae73b1SRuslan ErmilovThe
434bf60dfaSChris D. Faulhaber.Fn acl_add_perm
441fae73b1SRuslan Ermilovfunction
454bf60dfaSChris D. Faulhaberis a POSIX.1e call that adds the permission contained in
468480a1ebSRuslan Ermilov.Fa perm
474bf60dfaSChris D. Faulhaberto the permission set
488480a1ebSRuslan Ermilov.Fa permset_d .
494bf60dfaSChris D. Faulhaber.Pp
504bf60dfaSChris D. FaulhaberNote: it is not considered an error to attempt to add permissions
514bf60dfaSChris D. Faulhaberthat already exist in the permission set.
52f24f1c51SEdward Tomasz Napierala.Pp
53f24f1c51SEdward Tomasz NapieralaFor POSIX.1e ACLs, valid values are:
54aa015c8eSEdward Tomasz Napierala.Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS"
55f24f1c51SEdward Tomasz Napierala.It ACL_EXECUTE	Execute permission
56f24f1c51SEdward Tomasz Napierala.It ACL_WRITE	Write permission
57f24f1c51SEdward Tomasz Napierala.It ACL_READ	Read permission
58f24f1c51SEdward Tomasz Napierala.El
59aa015c8eSEdward Tomasz Napierala.Pp
60aa015c8eSEdward Tomasz NapieralaFor NFSv4 ACLs, valid values are:
61aa015c8eSEdward Tomasz Napierala.Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS"
62*288eac5aSJoel Dahl.It ACL_READ_DATA Ta "Read permission"
63*288eac5aSJoel Dahl.It ACL_LIST_DIRECTORY Ta "Same as ACL_READ_DATA"
64*288eac5aSJoel Dahl.It ACL_WRITE_DATA Ta "Write permission, or permission to create files"
65*288eac5aSJoel Dahl.It ACL_ADD_FILE Ta "Same as ACL_READ_DATA"
66*288eac5aSJoel Dahl.It ACL_APPEND_DATA Ta "Permission to create directories.  Ignored for files"
67*288eac5aSJoel Dahl.It ACL_ADD_SUBDIRECTORY Ta "Same as ACL_APPEND_DATA"
68*288eac5aSJoel Dahl.It ACL_READ_NAMED_ATTRS Ta "Ignored"
69*288eac5aSJoel Dahl.It ACL_WRITE_NAMED_ATTRS Ta "Ignored"
70*288eac5aSJoel Dahl.It ACL_EXECUTE Ta "Execute permission"
71*288eac5aSJoel Dahl.It ACL_DELETE_CHILD Ta "Permission to delete files and subdirectories"
72*288eac5aSJoel Dahl.It ACL_READ_ATTRIBUTES Ta "Permission to read basic attributes"
73*288eac5aSJoel Dahl.It ACL_WRITE_ATTRIBUTES Ta "Permission to change basic attributes"
74*288eac5aSJoel Dahl.It ACL_DELETE Ta "Permission to delete the object this ACL is placed on"
75*288eac5aSJoel Dahl.It ACL_READ_ACL Ta "Permission to read ACL"
76*288eac5aSJoel Dahl.It ACL_WRITE_ACL Ta "Permission to change the ACL and file mode"
77*288eac5aSJoel Dahl.It ACL_SYNCHRONIZE Ta "Ignored"
78aa015c8eSEdward Tomasz Napierala.El
79aa015c8eSEdward Tomasz Napierala.Pp
80aa015c8eSEdward Tomasz NapieralaCalling
81aa015c8eSEdward Tomasz Napierala.Fn acl_add_perm
82aa015c8eSEdward Tomasz Napieralawith
83aa015c8eSEdward Tomasz Napierala.Fa perm
84aa015c8eSEdward Tomasz Napieralaequal to ACL_WRITE or ACL_READ brands the ACL as POSIX.
85aa015c8eSEdward Tomasz NapieralaCalling it with ACL_READ_DATA, ACL_LIST_DIRECTORY, ACL_WRITE_DATA,
86aa015c8eSEdward Tomasz NapieralaACL_ADD_FILE, ACL_APPEND_DATA, ACL_ADD_SUBDIRECTORY, ACL_READ_NAMED_ATTRS,
87aa015c8eSEdward Tomasz NapieralaACL_WRITE_NAMED_ATTRS, ACL_DELETE_CHILD, ACL_READ_ATTRIBUTES,
88aa015c8eSEdward Tomasz NapieralaACL_WRITE_ATTRIBUTES, ACL_DELETE, ACL_READ_ACL, ACL_WRITE_ACL
89aa015c8eSEdward Tomasz Napieralaor ACL_SYNCHRONIZE brands the ACL as NFSv4.
904bf60dfaSChris D. Faulhaber.Sh RETURN VALUES
918480a1ebSRuslan Ermilov.Rv -std acl_add_perm
924bf60dfaSChris D. Faulhaber.Sh ERRORS
938480a1ebSRuslan ErmilovThe
944bf60dfaSChris D. Faulhaber.Fn acl_add_perm
958480a1ebSRuslan Ermilovfunction fails if:
964bf60dfaSChris D. Faulhaber.Bl -tag -width Er
974bf60dfaSChris D. Faulhaber.It Bq Er EINVAL
984bf60dfaSChris D. FaulhaberArgument
998480a1ebSRuslan Ermilov.Fa permset_d
1004bf60dfaSChris D. Faulhaberis not a valid descriptor for a permission set within an ACL entry.
1014bf60dfaSChris D. FaulhaberArgument
1028480a1ebSRuslan Ermilov.Fa perm
1034bf60dfaSChris D. Faulhaberdoes not contain a valid
1048480a1ebSRuslan Ermilov.Vt acl_perm_t
1054bf60dfaSChris D. Faulhabervalue.
106aa015c8eSEdward Tomasz NapieralaACL is already branded differently.
1074bf60dfaSChris D. Faulhaber.El
1084bf60dfaSChris D. Faulhaber.Sh SEE ALSO
1094bf60dfaSChris D. Faulhaber.Xr acl 3 ,
1104bf60dfaSChris D. Faulhaber.Xr acl_clear_perms 3 ,
111000d5619SMaxim Sobolev.Xr acl_delete_perm 3 ,
112aa015c8eSEdward Tomasz Napierala.Xr acl_get_brand_np 3 ,
1134bf60dfaSChris D. Faulhaber.Xr acl_get_permset 3 ,
1144bf60dfaSChris D. Faulhaber.Xr acl_set_permset 3 ,
1154bf60dfaSChris D. Faulhaber.Xr posix1e 3
1164bf60dfaSChris D. Faulhaber.Sh STANDARDS
1174bf60dfaSChris D. FaulhaberPOSIX.1e is described in IEEE POSIX.1e draft 17.
1184bf60dfaSChris D. Faulhaber.Sh HISTORY
1194bf60dfaSChris D. FaulhaberPOSIX.1e support was introduced in
1204bf60dfaSChris D. Faulhaber.Fx 4.0 .
1214bf60dfaSChris D. FaulhaberThe
1224bf60dfaSChris D. Faulhaber.Fn acl_add_perm
1234bf60dfaSChris D. Faulhaberfunction was added in
1244bf60dfaSChris D. Faulhaber.Fx 5.0 .
1254bf60dfaSChris D. Faulhaber.Sh AUTHORS
1264bf60dfaSChris D. FaulhaberThe
1274bf60dfaSChris D. Faulhaber.Fn acl_add_perm
1284bf60dfaSChris D. Faulhaberfunction was written by
1294bf60dfaSChris D. Faulhaber.An Chris D. Faulhaber Aq jedgar@fxp.org .
130