System Calls getaudit(2)
NAME
getaudit, setaudit, getauditaddr, setauditaddr - get or
set process audit information
SYNOPSIS
cc [ flag ... ] file ... -lbsm -lsocket -lnsl [ library ... ]
#include
#include
int getaudit(struct auditinfo *info);
int setaudit(struct auditinfo *info);
int getauditaddr(struct auditinfoaddr *info, int length);
int setauditaddr(struct auditinfoaddr *info, int length);
DESCRIPTION
The getaudit() function gets the audit ID, the preselection
mask, the terminal ID and the audit session ID for the
current process.
The getaudit() function can fail and return an E2BIG errno
if the address field in the terminal ID is larger than 32
bits. In this case, getauditaddr() should be used.
The setaudit() function sets the audit ID, the preselection
mask, the terminal ID and the audit session ID for the
current process.
The getauditaddr() function returns a variable length
auditinfoaddr structure that contains the audit ID, the
preselection mask, the terminal ID, and the audit session ID
for the current process. The terminal ID contains a size
field that indicates the size of the network address.
The setauditaddr() function sets the audit ID, the
preselection mask, the terminal ID, and the audit session
ID for the current process. The values are taken from the
variable length struture auditinfoaddr. The terminal ID
contains a size field that indicates the size of the network
address.
SunOS 5.11 Last change: 16 Apr 2008 1
System Calls getaudit(2)
The auditinfo structure is used to pass the process audit
information and contains the following members:
auidt aiauid; /* audit user ID */
aumaskt aimask; /* preselection mask */
autidt aitermid; /* terminal ID */
auasidt aiasid; /* audit session ID */
The auditinfoaddr structure is used to pass the process
audit information and contains the following members:
auidt aiauid; /* audit user ID */
aumaskt aimask; /* preselection mask */
autidaddrt aitermid; /* terminal ID */
auasidt aiasid; /* audit session ID */
RETURN VALUES
Upon successful completion, getaudit() and setaudit()
return 0. Otherwise, -1 is returned and errno is set to
indicate the error.
ERORS
The getaudit() and setaudit() functions will fail if:
EFAULT The info parameter points outside the process's
allocated address space.
EPERM The {PRIVSYSAUDIT} privilege is not asserted in
the effective set of the calling process.
USAGE
The calling process must have the {PRIVSYSAUDIT} privilege
asserted in its effective set.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 16 Apr 2008 2
System Calls getaudit(2)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Stable
MT-Level MT-Safe
SEE ALSO
bsmconv(1M), audit(2), attributes(5)
NOTES
The functionality described in this man page is available
only if the Solaris Auditing has been enabled. See
bsmconv(1M) for more information.
SunOS 5.11 Last change: 16 Apr 2008 3
|