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 GETAUDIT 2 "Mar 6, 2017"
8 getaudit, setaudit, getaudit_addr, setaudit_addr \- get or set process audit
13 cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lbsm\fR [ \fIlibrary\fR ... ]
14 #include <sys/param.h>
15 #include <bsm/libbsm.h>
17 \fBint\fR \fBgetaudit\fR(\fBstruct auditinfo *\fR\fIinfo\fR);
22 \fBint\fR \fBsetaudit\fR(\fBstruct auditinfo *\fR\fIinfo\fR);
27 \fBint\fR \fBgetaudit_addr\fR(\fBstruct auditinfo_addr *\fR\fIinfo\fR, \fBint\fR \fIlength\fR);
32 \fBint\fR \fBsetaudit_addr\fR(\fBstruct auditinfo_addr *\fR\fIinfo\fR, \fBint\fR \fIlength\fR);
37 The \fBgetaudit()\fR function gets the audit \fBID\fR, the preselection mask,
38 the terminal \fBID\fR and the audit session \fBID\fR for the current process.
41 The \fBgetaudit()\fR function can fail and return an \fBE2BIG\fR errno if the
42 address field in the terminal \fBID\fR is larger than 32 bits. In this case,
43 \fBgetaudit_addr()\fR should be used.
46 The \fBsetaudit()\fR function sets the audit \fBID\fR, the preselection mask,
47 the terminal \fBID\fR and the audit session \fBID\fR for the current process.
50 The \fBgetaudit_addr()\fR function returns a variable length
51 \fBauditinfo_addr\fR structure that contains the audit \fBID\fR, the
52 preselection mask, the terminal \fBID\fR, and the audit session \fBID\fR for
53 the current process. The terminal \fBID\fR contains a size field that indicates
54 the size of the network address.
57 The \fBsetaudit_addr()\fR function sets the audit \fBID\fR, the preselection
58 mask, the terminal \fBID\fR, and the audit session \fBID\fR for the current
59 process. The values are taken from the variable length structure
60 \fBauditinfo_addr\fR. The terminal \fBID\fR contains a size field that
61 indicates the size of the network address.
64 The \fBauditinfo\fR structure is used to pass the process audit information and
65 contains the following members:
69 au_id_t ai_auid; /* audit user ID */
70 au_mask_t ai_mask; /* preselection mask */
71 au_tid_t ai_termid; /* terminal ID */
72 au_asid_t ai_asid; /* audit session ID */
78 The \fBauditinfo_addr\fR structure is used to pass the process audit
79 information and contains the following members:
83 au_id_t ai_auid; /* audit user ID */
84 au_mask_t ai_mask; /* preselection mask */
85 au_tid_addr_t ai_termid; /* terminal ID */
86 au_asid_t ai_asid; /* audit session ID */
92 Upon successful completion, \fBgetaudit()\fR and \fBsetaudit()\fR return
93 \fB0\fR. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate
97 The \fBgetaudit()\fR and \fBsetaudit()\fR functions will fail if:
104 The \fIinfo\fR parameter points outside the process's allocated address space.
113 The {\fBPRIV_SYS_AUDIT\fR} privilege is not asserted in the effective set of
119 The calling process must have the {\fBPRIV_SYS_AUDIT\fR} privilege asserted in
123 See \fBattributes\fR(5) for descriptions of the following attributes:
131 ATTRIBUTE TYPE ATTRIBUTE VALUE
133 Interface Stability Stable
140 \fBaudit\fR(2), \fBattributes\fR(5)