1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
'\" te
.\" Copyright (c) 2008, 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 GETAUEVENT 3BSM "Mar 6, 2017"
.SH NAME
getauevent, getauevnam, getauevnum, getauevnonam, setauevent, endauevent,
getauevent_r, getauevnam_r, getauevnum_r \- get audit_event entry
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ]
#include <sys/param.h>
#include <bsm/libbsm.h>
\fBstruct au_event_ent *\fR\fBgetauevent\fR(\fBvoid\fR);
.fi
.LP
.nf
\fBstruct au_event_ent *\fR\fBgetauevnam\fR(\fBchar *\fR\fIname\fR);
.fi
.LP
.nf
\fBstruct au_event_ent *\fR\fBgetauevnum\fR(\fBau_event_t\fR \fIevent_number\fR);
.fi
.LP
.nf
\fBau_event_t\fR \fBgetauevnonam\fR(\fBchar *\fR\fIevent_name\fR);
.fi
.LP
.nf
\fBvoid\fR \fBsetauevent\fR(\fBvoid\fR);
.fi
.LP
.nf
\fBvoid\fR \fBendauevent\fR(\fBvoid\fR);
.fi
.LP
.nf
\fBstruct au_event_ent *\fR\fBgetauevent_r\fR(\fBau_event_ent_t *\fR\fIe\fR);
.fi
.LP
.nf
\fBstruct au_event_ent *\fR\fBgetauevnam_r\fR(\fBau_event_ent_t *\fR\fIe\fR, \fBchar *\fR\fIname\fR);
.fi
.LP
.nf
\fBstruct au_event_ent *\fR\fBgetauevnum_r\fR(\fBau_event_ent_t *\fR\fIe\fR,
\fBau_event_t\fR \fIevent_number\fR);
.fi
.SH DESCRIPTION
.LP
These functions document the programming interface for obtaining entries from
the \fBaudit_event\fR(4) file. The \fBgetauevent()\fR, \fBgetauevnam()\fR,
\fBgetauevnum()\fR, \fBgetauevent()\fR, \fBgetauevnam()\fR, and
\fBgetauevnum()\fR functions each return a pointer to an \fBaudit_event\fR
structure.
.sp
.LP
The \fBgetauevent()\fR and \fBgetauevent_r()\fR functions enumerate
\fBaudit_event\fR entries. Successive calls to these functions return either
successive \fBaudit_event\fR entries or \fINULL\fR.
.sp
.LP
The \fBgetauevnam()\fR and \fBgetauevnam_r()\fR functions search for an
\fBaudit_event\fR entry with \fIevent_name\fR.
.sp
.LP
The \fBgetauevnum()\fR and \fBgetauevnum_r()\fR functions search for an
\fBaudit_event\fR entry with \fIevent_number\fR.
.sp
.LP
The \fBgetauevnonam()\fR function searches for an \fBaudit_event\fR entry with
\fIevent_name\fR and returns the corresponding event number.
.sp
.LP
The \fBsetauevent()\fR function ``rewinds'' to the beginning of the enumeration
of \fBaudit_event\fR entries. Calls to \fBgetauevnam()\fR,
\fBgetauevnum()\fR, \fBgetauevnonum()\fR, \fBgetauevnam_r()\fR, or
\fBgetauevnum_r()\fR can leave the enumeration in an indeterminate state. The
\fBsetauevent()\fR function should be called before the first call to
\fBgetauevent()\fR or \fBgetauevent_r()\fR.
.sp
.LP
The \fBendauevent()\fR function can be called to indicate that
\fBaudit_event\fR processing is complete. The system can then close any open
\fBaudit_event\fR file, deallocate storage, and so forth.
.sp
.LP
The \fBgetauevent_r()\fR, \fBgetauevnam_r()\fR, and \fBgetauevnum_r()\fR
functions each take an argument \fIe\fR, which is a pointer to an
\fBau_event_ent_t\fR. This pointer is returned on a successful function call.
To assure there is enough space for the information returned, the applications
programmer should be sure to allocate \fBAU_EVENT_NAME_MAX\fR and
\fBAU_EVENT_DESC_MAX\fR bytes for the \fBae_name\fR and \fBac_desc\fR elements
of the \fBau_event_ent_t\fR data structure.
.sp
.LP
The internal representation of an \fBaudit_event\fR entry is an
\fBau_event_ent\fR structure defined in <\fBbsm/libbsm.h\fR> with the following
members:
.sp
.in +2
.nf
au_event_t ae_number
char *ae_name;
char *ae_desc*;
au_class_t ae_class;
.fi
.in -2
.SH RETURN VALUES
.LP
The \fBgetauevent()\fR, \fBgetauevnam()\fR, \fBgetauevnum()\fR,
\fBgetauevent_r()\fR, \fBgetauevnam_r()\fR, and \fBgetauevnum_r()\fR functions
return a pointer to a \fBau_event_ent\fR structure if the requested entry is
successfully located. Otherwise they return \fINULL\fR.
.sp
.LP
The \fBgetauevnonam()\fR function returns an event number of type
\fBau_event_t\fR if it successfully enumerates an entry. Otherwise it returns
\fINULL\fR, indicating it could not find the requested event name.
.SH FILES
.ne 2
.na
\fB\fB/etc/security/audit_event\fR\fR
.ad
.RS 29n
file that maps audit event numbers to audit event names
.RE
.sp
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 29n
file that stores user-ID to username mappings
.RE
.SH ATTRIBUTES
.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
The \fBgetauevent()\fR, \fBgetauevnam()\fR, and \fBgetauevnum()\fR functions
are Unsafe. The equivalent functions \fBgetauevent_r()\fR,
\fBgetauevnam_r()\fR, and \fBgetauevnum_r()\fR provide the same functionality
and an MT-Safe function call interface.
.SH SEE ALSO
.LP
\fBgetauclassent\fR(3BSM), \fBgetpwnam\fR(3C),
\fBaudit_class\fR(4), \fBaudit_event\fR(4), \fBpasswd\fR(4),
\fBattributes\fR(5)
.SH NOTES
.LP
All information for the \fBgetauevent()\fR, \fBgetauevnam()\fR, and
\fBgetauevnum()\fR functions is contained in a static area, so it must be
copied if it is to be saved.
|