Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man3sec / acltomode.3sec
blobbc8bb9ff6c96a993147e8c9041bea5baf2b1be26
1 '\" te
2 .\" Copyright (c) 2001, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ACLTOMODE 3SEC "Dec 10, 2001"
7 .SH NAME
8 acltomode, aclfrommode \- convert an ACL to or from permission bits
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsec\fR [ \fIlibrary\fR... ]
13 #include <sys/types.h>
14 #include <sys/acl.h>
18 \fBint\fR \fBacltomode\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fInentries\fR, \fBmode_t *\fR\fImodep\fR);
19 .fi
21 .LP
22 .nf
23 \fBint\fR \fBaclfrommode\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fInentries\fR, \fBmode_t *\fR\fImodep\fR);
24 .fi
26 .SH DESCRIPTION
27 .sp
28 .LP
29 The \fBacltomode()\fR function converts an \fBACL\fR pointed to by
30 \fIaclbufp\fR into the permission bits buffer pointed to by \fImodep\fR. If the
31 \fBUSER_OBJ\fR \fBACL\fR entry, \fBGROUP_OBJ\fR \fBACL\fR entry, or the
32 \fBOTHER_OBJ\fR \fBACL\fR entry cannot be found in  the \fBACL\fR buffer, then
33 the function fails with \fBerrno\fR set to \fBEINVAL\fR.
34 .sp
35 .LP
36 The \fBUSER_OBJ\fR \fBACL\fR entry permission bits are copied to the file owner
37 class bits in the permission bits buffer. The \fBOTHER_OBJ\fR \fBACL\fR entry
38 permission bits are copied to the file other class bits in the permission bits
39 buffer. If there is a \fBCLASS_OBJ\fR (\fBACL\fR mask) entry, the
40 \fBCLASS_OBJ\fR \fBACL\fR entry permission bits are copied to the file group
41 class bits in the permission bits buffer. Otherwise, the \fBGROUP_OBJ\fR
42 \fBACL\fR entry permission bits are copied to the file group class bits in the
43 permission bits buffer.
44 .sp
45 .LP
46 The \fBaclfrommode()\fR function converts the permission bits pointed to by
47 \fImodep\fR into an ACL pointed to by \fIaclbufp\fR. If the \fBUSER_OBJ\fR
48 \fBACL\fR entry, \fBGROUP_OBJ\fR ACL entry, or the \fBOTHER_OBJ\fR ACL entry
49 cannot be found in the \fBACL\fR buffer, the function fails with  \fBerrno\fR
50 set to \fBEINVAL\fR.
51 .sp
52 .LP
53 The file owner class bits from the permission bits buffer are copied to the
54 \fBUSER_OBJ\fR \fBACL\fR entry. The file other class bits from the permission
55 bits buffer are copied to  the \fBOTHER_OBJ\fR \fBACL\fR entry. If there is a
56 \fBCLASS_OBJ\fR (\fBACL\fR mask) entry, the file group class bits from the
57 permission bits buffer are copied to the \fBCLASS_OBJ\fR \fBACL\fR entry, and
58 the \fBGROUP_OBJ\fR \fBACL\fR entry is not modified. Otherwise, the file group
59 class bits from the permission bits buffer are copied to the \fBGROUP_OBJ\fR
60 \fBACL\fR entry.
61 .sp
62 .LP
63 The \fInentries\fR argument represents the number of \fBACL\fR entries in the
64 buffer pointed to by \fIaclbufp\fR.
65 .SH RETURN VALUES
66 .sp
67 .LP
68 Upon successful completion, the function returns \fB0\fR. Otherwise, it returns
69 \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
70 .SH ATTRIBUTES
71 .sp
72 .LP
73 See \fBattributes\fR(5) for descriptions of the following attributes:
74 .sp
76 .sp
77 .TS
78 box;
79 c | c
80 l | l .
81 ATTRIBUTE TYPE  ATTRIBUTE VALUE
83 Interface Stability     Evolving
85 MT-Level        Unsafe
86 .TE
88 .SH SEE ALSO
89 .sp
90 .LP
91 \fBacl\fR(2), \fBattributes\fR(5)