'\" te .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. .\" 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. .\" 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. .\" 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] .TH GETAUCLASSENT 3BSM "Mar 31, 2005" .SH NAME getauclassent, getauclassnam, setauclass, endauclass, getauclassnam_r, getauclassent_r \- get audit_class entry .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ] #include #include \fBstruct au_class_ent *\fR\fBgetauclassnam\fR(\fB const char *\fR\fIname\fR); .fi .LP .nf \fBstruct au_class_ent *\fR\fBgetauclassnam_r\fR(\fB au_class_ent_t *\fR\fIclass_int\fR, \fBconst char *\fR\fIname\fR); .fi .LP .nf \fBstruct au_class_ent *\fR\fBgetauclassent\fR(\fBvoid\fR); .fi .LP .nf \fBstruct au_class_ent *\fR\fBgetauclassent_r\fR(\fB au_class_ent_t *\fR\fIclass_int\fR); .fi .LP .nf \fBvoid\fR \fBsetauclass\fR(\fBvoid\fR); .fi .LP .nf \fBvoid\fR \fBendauclass\fR(\fBvoid\fR); .fi .SH DESCRIPTION .sp .LP The \fBgetauclassent()\fR function and \fBgetauclassnam()\fR each return an \fBaudit_class\fR entry. .sp .LP The \fBgetauclassnam()\fR function searches for an \fBaudit_class\fR entry with a given class name \fIname.\fR .sp .LP The \fBgetauclassent()\fR function enumerates audit_class entries. Successive calls to \fBgetauclassent()\fR return either successive audit_class entries or \fINULL\fR. .sp .LP The \fBsetauclass()\fR function ``rewinds'' to the beginning of the enumeration of audit_class entries. Calls to \fBgetauclassnam()\fR may leave the enumeration in an indeterminate state, so \fBsetauclass()\fR should be called before the first \fBgetauclassent()\fR. .sp .LP The \fBendauclass()\fR may be called to indicate that audit_class processing is complete; the system may then close any open audit_class file, deallocate storage, and so forth. .sp .LP The \fBgetauclassent_r()\fR and \fBgetauclassnam_r()\fR functions both return a pointer to an audit_class entry as do their similarly named counterparts. They each take an additional argument, a pointer to pre-allocated space for an \fBau_class_ent_t\fR, which is returned if the call is successful. To assure there is enough space for the information returned, the applications programmer should be sure to allocate \fBAU_CLASS_NAME_MAX\fR and \fBAU_CLASS_DESC_MAX\fR bytes for the \fBac_name\fR and \fBac_desc\fR members of the \fBau_class_ent_t\fR data structure. .sp .LP The internal representation of an \fBaudit_user\fR entry is an \fBau_class_ent\fR structure defined in <\fBbsm/libbsm.h\fR> with the following members: .sp .in +2 .nf char *ac_name; au_class_t ac_class; char *ac_desc; .fi .in -2 .SH RETURN VALUES .sp .LP The \fBgetauclassnam()\fR and \fBgetauclassnam_r()\fR functions return a pointer to a \fBau_class_ent\fR structure if they successfully locate the requested entry. Otherwise they return \fINULL\fR. .sp .LP The \fBgetauclassent()\fR and \fBgetauclassent_r()\fR functions return a pointer to a \fBau_class_ent\fR structure if they successfully enumerate an entry. Otherwise they return \fINULL\fR, indicating the end of the enumeration. .SH FILES .sp .ne 2 .na \fB\fB/etc/security/audit_class\fR\fR .ad .RS 29n file that aps audit class numbers to audit class names .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level MT-Safe with exceptions. .TE .sp .LP All of the functions described on this man-page are MT-Safe except \fBgetauclassent()\fR and \fBgetauclassnam\fR, which are Unsafe. The \fBgetauclassent_r()\fR and \fBgetauclassnam_r()\fR functions have the same functionality as the Unsafe functions, but have a slightly different function call interface to make them MT-Safe. .SH SEE ALSO .sp .LP \fBbsmconv\fR(1M), \fBaudit_class\fR(4), \fBaudit_event\fR(4), \fBattributes\fR(5) .SH NOTES .sp .LP All information is contained in a static area, so it must be copied if it is to be saved. .sp .LP The functionality described on this manual page is available only if the Solaris Auditing has been enabled. See \fBbsmconv\fR(1M) for more information.