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
|
'\" 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 "31 Mar 2005" "SunOS 5.11" "Security and Auditing Library Functions"
.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 <sys/param.h>
#include <bsm/libbsm.h>
\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
.mk
.na
\fB\fB/etc/security/audit_user\fR\fR
.ad
.RS 28n
.rt
file that stores per-user audit event mask
.RE
.sp
.ne 2
.mk
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 28n
.rt
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
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
MT-LevelMT-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.
|