'\" te .\" Copyright (c) 2001, Sun Microsystems, Inc. .TH acltomode 3SEC "10 Dec 2001" "SunOS 5.11" "File Access Control Library Functions" .SH NAME acltomode, aclfrommode \- convert an ACL to or from permission bits .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsec\fR [ \fIlibrary\fR... ] #include #include \fBint\fR \fBacltomode\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fInentries\fR, \fBmode_t *\fR\fImodep\fR); .fi .LP .nf \fBint\fR \fBaclfrommode\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fInentries\fR, \fBmode_t *\fR\fImodep\fR); .fi .SH DESCRIPTION .sp .LP The \fBacltomode()\fR function converts an \fBACL\fR pointed to by \fIaclbufp\fR into the permission bits buffer pointed to by \fImodep\fR. If the \fBUSER_OBJ\fR \fBACL\fR entry, \fBGROUP_OBJ\fR \fBACL\fR entry, or the \fBOTHER_OBJ\fR \fBACL\fR entry cannot be found in the \fBACL\fR buffer, then the function fails with \fBerrno\fR set to \fBEINVAL\fR. .sp .LP The \fBUSER_OBJ\fR \fBACL\fR entry permission bits are copied to the file owner class bits in the permission bits buffer. The \fBOTHER_OBJ\fR \fBACL\fR entry permission bits are copied to the file other class bits in the permission bits buffer. If there is a \fBCLASS_OBJ\fR (\fBACL\fR mask) entry, the \fBCLASS_OBJ\fR \fBACL\fR entry permission bits are copied to the file group class bits in the permission bits buffer. Otherwise, the \fBGROUP_OBJ\fR \fBACL\fR entry permission bits are copied to the file group class bits in the permission bits buffer. .sp .LP The \fBaclfrommode()\fR function converts the permission bits pointed to by \fImodep\fR into an ACL pointed to by \fIaclbufp\fR. If the \fBUSER_OBJ\fR \fBACL\fR entry, \fBGROUP_OBJ\fR ACL entry, or the \fBOTHER_OBJ\fR ACL entry cannot be found in the \fBACL\fR buffer, the function fails with \fBerrno\fR set to \fBEINVAL\fR. .sp .LP The file owner class bits from the permission bits buffer are copied to the \fBUSER_OBJ\fR \fBACL\fR entry. The file other class bits from the permission bits buffer are copied to the \fBOTHER_OBJ\fR \fBACL\fR entry. If there is a \fBCLASS_OBJ\fR (\fBACL\fR mask) entry, the file group class bits from the permission bits buffer are copied to the \fBCLASS_OBJ\fR \fBACL\fR entry, and the \fBGROUP_OBJ\fR \fBACL\fR entry is not modified. Otherwise, the file group class bits from the permission bits buffer are copied to the \fBGROUP_OBJ\fR \fBACL\fR entry. .sp .LP The \fInentries\fR argument represents the number of \fBACL\fR entries in the buffer pointed to by \fIaclbufp\fR. .SH RETURN VALUES .sp .LP Upon successful completion, the function returns \fB0\fR. Otherwise, it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error. .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 Stability Committed _ MT-LevelUnsafe .TE .SH SEE ALSO .sp .LP \fBacl\fR(2), \fBattributes\fR(5)