2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
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 GETAUEVENT 3BSM "Mar 6, 2017"
8 getauevent, getauevnam, getauevnum, getauevnonam, setauevent, endauevent,
9 getauevent_r, getauevnam_r, getauevnum_r \- get audit_event entry
13 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ]
14 #include <sys/param.h>
15 #include <bsm/libbsm.h>
17 \fBstruct au_event_ent *\fR\fBgetauevent\fR(\fBvoid\fR);
22 \fBstruct au_event_ent *\fR\fBgetauevnam\fR(\fBchar *\fR\fIname\fR);
27 \fBstruct au_event_ent *\fR\fBgetauevnum\fR(\fBau_event_t\fR \fIevent_number\fR);
32 \fBau_event_t\fR \fBgetauevnonam\fR(\fBchar *\fR\fIevent_name\fR);
37 \fBvoid\fR \fBsetauevent\fR(\fBvoid\fR);
42 \fBvoid\fR \fBendauevent\fR(\fBvoid\fR);
47 \fBstruct au_event_ent *\fR\fBgetauevent_r\fR(\fBau_event_ent_t *\fR\fIe\fR);
52 \fBstruct au_event_ent *\fR\fBgetauevnam_r\fR(\fBau_event_ent_t *\fR\fIe\fR, \fBchar *\fR\fIname\fR);
57 \fBstruct au_event_ent *\fR\fBgetauevnum_r\fR(\fBau_event_ent_t *\fR\fIe\fR,
58 \fBau_event_t\fR \fIevent_number\fR);
63 These functions document the programming interface for obtaining entries from
64 the \fBaudit_event\fR(4) file. The \fBgetauevent()\fR, \fBgetauevnam()\fR,
65 \fBgetauevnum()\fR, \fBgetauevent()\fR, \fBgetauevnam()\fR, and
66 \fBgetauevnum()\fR functions each return a pointer to an \fBaudit_event\fR
70 The \fBgetauevent()\fR and \fBgetauevent_r()\fR functions enumerate
71 \fBaudit_event\fR entries. Successive calls to these functions return either
72 successive \fBaudit_event\fR entries or \fINULL\fR.
75 The \fBgetauevnam()\fR and \fBgetauevnam_r()\fR functions search for an
76 \fBaudit_event\fR entry with \fIevent_name\fR.
79 The \fBgetauevnum()\fR and \fBgetauevnum_r()\fR functions search for an
80 \fBaudit_event\fR entry with \fIevent_number\fR.
83 The \fBgetauevnonam()\fR function searches for an \fBaudit_event\fR entry with
84 \fIevent_name\fR and returns the corresponding event number.
87 The \fBsetauevent()\fR function ``rewinds'' to the beginning of the enumeration
88 of \fBaudit_event\fR entries. Calls to \fBgetauevnam()\fR,
89 \fBgetauevnum()\fR, \fBgetauevnonum()\fR, \fBgetauevnam_r()\fR, or
90 \fBgetauevnum_r()\fR can leave the enumeration in an indeterminate state. The
91 \fBsetauevent()\fR function should be called before the first call to
92 \fBgetauevent()\fR or \fBgetauevent_r()\fR.
95 The \fBendauevent()\fR function can be called to indicate that
96 \fBaudit_event\fR processing is complete. The system can then close any open
97 \fBaudit_event\fR file, deallocate storage, and so forth.
100 The \fBgetauevent_r()\fR, \fBgetauevnam_r()\fR, and \fBgetauevnum_r()\fR
101 functions each take an argument \fIe\fR, which is a pointer to an
102 \fBau_event_ent_t\fR. This pointer is returned on a successful function call.
103 To assure there is enough space for the information returned, the applications
104 programmer should be sure to allocate \fBAU_EVENT_NAME_MAX\fR and
105 \fBAU_EVENT_DESC_MAX\fR bytes for the \fBae_name\fR and \fBac_desc\fR elements
106 of the \fBau_event_ent_t\fR data structure.
109 The internal representation of an \fBaudit_event\fR entry is an
110 \fBau_event_ent\fR structure defined in <\fBbsm/libbsm.h\fR> with the following
124 The \fBgetauevent()\fR, \fBgetauevnam()\fR, \fBgetauevnum()\fR,
125 \fBgetauevent_r()\fR, \fBgetauevnam_r()\fR, and \fBgetauevnum_r()\fR functions
126 return a pointer to a \fBau_event_ent\fR structure if the requested entry is
127 successfully located. Otherwise they return \fINULL\fR.
130 The \fBgetauevnonam()\fR function returns an event number of type
131 \fBau_event_t\fR if it successfully enumerates an entry. Otherwise it returns
132 \fINULL\fR, indicating it could not find the requested event name.
136 \fB\fB/etc/security/audit_event\fR\fR
139 file that maps audit event numbers to audit event names
145 \fB\fB/etc/passwd\fR\fR
148 file that stores user-ID to username mappings
153 See \fBattributes\fR(5) for descriptions of the following attributes:
161 ATTRIBUTE TYPE ATTRIBUTE VALUE
163 MT-Level MT-Safe with exceptions
168 The \fBgetauevent()\fR, \fBgetauevnam()\fR, and \fBgetauevnum()\fR functions
169 are Unsafe. The equivalent functions \fBgetauevent_r()\fR,
170 \fBgetauevnam_r()\fR, and \fBgetauevnum_r()\fR provide the same functionality
171 and an MT-Safe function call interface.
174 \fBgetauclassent\fR(3BSM), \fBgetpwnam\fR(3C),
175 \fBaudit_class\fR(4), \fBaudit_event\fR(4), \fBpasswd\fR(4),
179 All information for the \fBgetauevent()\fR, \fBgetauevnam()\fR, and
180 \fBgetauevnum()\fR functions is contained in a static area, so it must be
181 copied if it is to be saved.