9075 Improve ZFS pool import/load process and corrupted pool recovery
[unleashed.git] / usr / src / man / man3sec / aclsort.3sec
blob248dab28def58653714e0174d8713045993bf107
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 ACLSORT 3SEC "Dec 10, 2001"
7 .SH NAME
8 aclsort \- sort an ACL
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsec\fR [ \fIlibrary\fR ... ]
13 #include <sys/acl.h>
15 \fBint\fR \fBaclsort\fR(\fBint\fR \fInentries\fR, \fBint\fR \fIcalclass\fR, \fBaclent_t *\fR\fIaclbufp\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fIaclbufp\fR argument points to a buffer containing \fBACL\fR entries. The
22 \fInentries\fR argument specifies the number of \fBACL\fR entries in the
23 buffer. The \fIcalclass\fR argument, if non-zero, indicates that the
24 \fBCLASS_OBJ\fR (\fBACL\fR mask) permissions should be recalculated. The union
25 of the permission bits associated with all \fBACL\fR entries in the buffer
26 other than \fBCLASS_OBJ\fR, \fBOTHER_OBJ\fR, and \fBUSER_OBJ\fR is calculated.
27 The result is copied to the permission bits associated with the \fBCLASS_OBJ\fR
28 entry.
29 .sp
30 .LP
31 The \fBaclsort()\fR function sorts the contents of the \fBACL\fR buffer as
32 follows:
33 .RS +4
34 .TP
35 .ie t \(bu
36 .el o
37 Entries will be in the order \fBUSER_OBJ\fR, \fBUSER\fR, \fBGROUP_OBJ\fR,
38 \fBGROUP\fR, \fBCLASS_OBJ\fR (\fBACL\fR mask), \fBOTHER_OBJ\fR,
39 \fBDEF_USER_OBJ\fR, \fBDEF_USER\fR, \fBDEF_GROUP_OBJ\fR, \fBDEF_GROUP\fR,
40 \fBDEF_CLASS_OBJ\fR (default \fBACL\fR mask), and \fBDEF_OTHER_OBJ\fR.
41 .RE
42 .RS +4
43 .TP
44 .ie t \(bu
45 .el o
46 Entries of type \fBUSER\fR, \fBGROUP\fR, \fBDEF_USER\fR, and \fBDEF_GROUP\fR
47 will be sorted in increasing order by \fBID\fR.
48 .RE
49 .sp
50 .LP
51 The \fBaclsort()\fR function will succeed if all of the following are true:
52 .RS +4
53 .TP
54 .ie t \(bu
55 .el o
56 There is exactly one entry each of type \fBUSER_OBJ\fR, \fBGROUP_OBJ\fR,
57 \fBCLASS_OBJ\fR (\fBACL\fR mask), and \fBOTHER_OBJ\fR.
58 .RE
59 .RS +4
60 .TP
61 .ie t \(bu
62 .el o
63 There is exactly one entry each of type \fBDEF_USER_OBJ\fR,
64 \fBDEF_GROUP_OBJ\fR, \fBDEF_CLASS_OBJ\fR (default \fBACL\fR mask), and
65 \fBDEF_OTHER_OBJ\fR if there are any default entries.
66 .RE
67 .RS +4
68 .TP
69 .ie t \(bu
70 .el o
71 Entries of type \fBUSER\fR, \fBGROUP\fR, \fBDEF_USER\fR, or \fBDEF_GROUP\fR may
72 not contain duplicate entries. A duplicate entry is one of the same type
73 containing the same numeric \fBID\fR.
74 .RE
75 .SH RETURN VALUES
76 .sp
77 .LP
78 Upon successful completion, the function returns \fB0\fR. Otherwise, it returns
79 \fB\(mi1\fR\&.
80 .SH ATTRIBUTES
81 .sp
82 .LP
83 See \fBattributes\fR(5) for descriptions of the following attributes:
84 .sp
86 .sp
87 .TS
88 box;
89 c | c
90 l | l .
91 ATTRIBUTE TYPE  ATTRIBUTE VALUE
93 Interface Stability     Evolving
95 MT-Level        Unsafe
96 .TE
98 .SH SEE ALSO
99 .sp
101 \fBacl\fR(2), \fBaclcheck\fR(3SEC), \fBattributes\fR(5)