| Current File : //usr/share/man/man3sec/aclsort.3sec |
'\" te
.\" Copyright (c) 2001, Sun Microsystems, Inc.
.TH aclsort 3SEC "10 Dec 2001" "SunOS 5.11" "File Access Control Library Functions"
.SH NAME
aclsort \- sort an ACL
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsec\fR [ \fIlibrary\fR ... ]
#include <sys/acl.h>
\fBint\fR \fBaclsort\fR(\fBint\fR \fInentries\fR, \fBint\fR \fIcalclass\fR, \fBaclent_t *\fR\fIaclbufp\fR);
.fi
.SH DESCRIPTION
.sp
.LP
The \fIaclbufp\fR argument points to a buffer containing \fBACL\fR entries. The \fInentries\fR argument specifies the number of \fBACL\fR entries in the buffer. The \fIcalclass\fR argument, if non-zero, indicates that the \fBCLASS_OBJ\fR (\fBACL\fR mask) permissions should be recalculated. The union of the permission bits associated with all \fBACL\fR entries in the buffer other than \fBCLASS_OBJ\fR, \fBOTHER_OBJ\fR, and \fBUSER_OBJ\fR is calculated. The result is copied to the permission bits associated with the \fBCLASS_OBJ\fR entry.
.sp
.LP
The \fBaclsort()\fR function sorts the contents of the \fBACL\fR buffer as follows:
.RS +4
.TP
.ie t \(bu
.el o
Entries will be in the order \fBUSER_OBJ\fR, \fBUSER\fR, \fBGROUP_OBJ\fR, \fBGROUP\fR, \fBCLASS_OBJ\fR (\fBACL\fR mask), \fBOTHER_OBJ\fR, \fBDEF_USER_OBJ\fR, \fBDEF_USER\fR, \fBDEF_GROUP_OBJ\fR, \fBDEF_GROUP\fR, \fBDEF_CLASS_OBJ\fR (default \fBACL\fR mask), and \fBDEF_OTHER_OBJ\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Entries of type \fBUSER\fR, \fBGROUP\fR, \fBDEF_USER\fR, and \fBDEF_GROUP\fR will be sorted in increasing order by \fBID\fR.
.RE
.sp
.LP
The \fBaclsort()\fR function will succeed if all of the following are true:
.RS +4
.TP
.ie t \(bu
.el o
There is exactly one entry each of type \fBUSER_OBJ\fR, \fBGROUP_OBJ\fR, \fBCLASS_OBJ\fR (\fBACL\fR mask), and \fBOTHER_OBJ\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
There is exactly one entry each of type \fBDEF_USER_OBJ\fR, \fBDEF_GROUP_OBJ\fR, \fBDEF_CLASS_OBJ\fR (default \fBACL\fR mask), and \fBDEF_OTHER_OBJ\fR if there are any default entries.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Entries of type \fBUSER\fR, \fBGROUP\fR, \fBDEF_USER\fR, or \fBDEF_GROUP\fR may not contain duplicate entries. A duplicate entry is one of the same type containing the same numeric \fBID\fR.
.RE
.SH RETURN VALUES
.sp
.LP
Upon successful completion, the function returns \fB0\fR. Otherwise, it returns \fB\(mi1\fR\&.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityCommitted
_
MT-LevelUnsafe
.TE
.SH SEE ALSO
.sp
.LP
\fBacl\fR(2), \fBaclcheck\fR(3SEC), \fBattributes\fR(5)