'\" 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 GETAUUSERNAM 3BSM "Mar 31, 2005" .SH NAME getauusernam, getauuserent, setauuser, endauuser, getauusernam_r, getauuserent_r \- get audit_user 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_user_ent *\fR\fBgetauusernam\fR(\fBconst char *\fR\fIname\fR); .fi .LP .nf \fBstruct au_user_ent *\fR\fBgetauuserent\fR(\fBvoid\fR); .fi .LP .nf \fBvoid\fR \fBsetauuser\fR(\fBvoid\fR); .fi .LP .nf \fBvoid\fR \fBendauuser\fR(\fBvoid\fR); .fi .LP .nf \fBstruct au_user_ent *\fR\fBgetauusernam_r\fR(\fBau_user_ent_t *\fR\fIu\fR, \fBconst char *\fR\fIname\fR); .fi .LP .nf \fBstruct au_user_ent *\fR\fBgetauuserent_r\fR(\fBau_user_ent_t *\fR\fIu\fR); .fi .SH DESCRIPTION .sp .LP The \fBgetauuserent()\fR, \fBgetauusernam()\fR, \fBgetauuserent_r()\fR, and \fBgetauusernam_r()\fR functions each return an \fBaudit_user\fR entry. Entries can come from any of the sources specified in the \fB/etc/nsswitch.conf\fR file (see \fBnsswitch.conf\fR(4)). .sp .LP The \fBgetauusernam()\fR and \fBgetauusernam_r()\fR functions search for an \fBaudit_user\fR entry with a given login name \fIname\fR. .sp .LP The \fBgetauuserent()\fR and \fBgetauuserent_r()\fR functions enumerate \fBaudit_user\fR entries; successive calls to these functions will return either successive \fBaudit_user\fR entries or \fINULL\fR. .sp .LP The \fBsetauuser()\fR function "rewinds" to the beginning of the enumeration of \fBaudit_user\fR entries. Calls to \fBgetauusernam()\fR and \fBgetauusernam_r()\fR may leave the enumeration in an indeterminate state, so \fBsetauuser()\fR should be called before the first call to \fBgetauuserent()\fR or \fBgetauuserent_r()\fR. .sp .LP The \fBendauuser()\fR function may be called to indicate that \fBaudit_user\fR processing is complete; the system may then close any open \fBaudit_user\fR file, deallocate storage, and so forth. .sp .LP The \fBgetauuserent_r()\fR and \fBgetauusernam_r()\fR functions both take as an argument a pointer to an \fBau_user_ent\fR that is returned on successful function calls. .sp .LP The internal representation of an \fBaudit_user\fR entry is an \fBau_user_ent\fR structure defined in <\fBbsm/libbsm.h\fR> with the following members: .sp .in +2 .nf char *au_name; au_mask_t au_always; au_mask_t au_never; .fi .in -2 .SH RETURN VALUES .sp .LP The \fBgetauusernam()\fR function returns a pointer to a \fBau_user_ent\fR structure if it successfully locates the requested entry. Otherwise it returns \fINULL\fR. .sp .LP The \fBgetauuserent()\fR function returns a pointer to a \fBau_user_ent\fR structure if it successfully enumerates an entry. Otherwise it returns \fINULL\fR, indicating the end of the enumeration. .SH USAGE .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. .SH FILES .sp .ne 2 .na \fB\fB/etc/security/audit_user\fR\fR .ad .RS 28n file that stores per-user audit event mask .RE .sp .ne 2 .na \fB\fB/etc/passwd\fR\fR .ad .RS 28n file that stores user ID to username mappings .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 .SH SEE ALSO .sp .LP \fBbsmconv\fR(1M), \fBgetpwnam\fR(3C), \fBaudit_user\fR(4), \fBnsswitch.conf\fR(4), \fBpasswd\fR(4), \fBattributes\fR(5) .SH NOTES .sp .LP All information for the \fBgetauuserent()\fR and \fBgetauusernam()\fR functions is contained in a static area, so it must be copied if it is to be saved. .sp .LP The \fBgetauusernam()\fR and \fBgetauuserent()\fR functions are Unsafe in multithreaded applications. The \fBgetauusernam_r()\fR and \fBgetauuserent_r()\fR functions provide the same functionality with interfaces that are MT-Safe.