1getaudit(2)                      System Calls                      getaudit(2)
2
3
4

NAME

6       getaudit,  setaudit,  getaudit_addr, setaudit_addr - get or set process
7       audit information
8

SYNOPSIS

10       cc [ flag ... ] file ... -lbsm  -lsocket   -lnsl   [ library ... ]
11       #include <sys/param.h>
12       #include <bsm/libbsm.h>
13
14       int getaudit(struct auditinfo *info);
15
16
17       int setaudit(struct auditinfo *info);
18
19
20       int getaudit_addr(struct auditinfo_addr *info, int length);
21
22
23       int setaudit_addr(struct auditinfo_addr *info, int length);
24
25

DESCRIPTION

27       The getaudit() function gets the audit ID, the preselection  mask,  the
28       terminal ID and the audit session ID for the current process.
29
30
31       The  getaudit()  function  can  fail  and  return an E2BIG errno if the
32       address field in the terminal ID is larger than 32 bits. In this  case,
33       getaudit_addr() should be used.
34
35
36       The  setaudit()  function sets the audit ID, the preselection mask, the
37       terminal ID and the audit session ID for the current process.
38
39
40       The getaudit_addr() function returns a variable  length  auditinfo_addr
41       structure that contains the audit ID, the preselection mask, the termi‐
42       nal ID, and the audit session ID for the current process. The  terminal
43       ID  contains  a  size  field  that  indicates  the  size of the network
44       address.
45
46
47       The setaudit_addr() function sets the audit ID, the preselection  mask,
48       the terminal ID, and  the audit session ID for the current process. The
49       values are taken from the variable length struture auditinfo_addr.  The
50       terminal  ID  contains a size field that indicates the size of the net‐
51       work address.
52
53
54       The auditinfo structure is used to pass the process  audit  information
55       and contains the following members:
56
57         au_id_t     ai_auid;        /* audit user ID */
58         au_mask_t   ai_mask;        /* preselection mask */
59         au_tid_t    ai_termid;      /* terminal ID */
60         au_asid_t   ai_asid;        /* audit session ID */
61
62
63
64       The auditinfo_addr structure is used to pass the process audit informa‐
65       tion and contains the following members:
66
67         au_id_t        ai_auid;      /* audit user ID */
68         au_mask_t      ai_mask;      /* preselection mask */
69         au_tid_addr_t  ai_termid;    /* terminal ID */
70         au_asid_t      ai_asid;      /* audit session ID */
71
72

RETURN VALUES

74       Upon successful completion, getaudit() and  setaudit() return 0. Other‐
75       wise, −1 is returned and errno is set to indicate the error.
76

ERRORS

78       The getaudit() and setaudit() functions will fail if:
79
80       EFAULT    The  info  parameter  points  outside the process's allocated
81                 address space.
82
83
84       EPERM     The {PRIV_SYS_AUDIT} privilege is not asserted in the  effec‐
85                 tive set of the calling process.
86
87

USAGE

89       The  calling  process must have the {PRIV_SYS_AUDIT} privilege asserted
90       in its effective set.
91

ATTRIBUTES

93       See attributes(5) for descriptions of the following attributes:
94
95
96
97
98       ┌─────────────────────────────┬─────────────────────────────┐
99       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
100       ├─────────────────────────────┼─────────────────────────────┤
101       │Interface Stability          │Stable                       │
102       ├─────────────────────────────┼─────────────────────────────┤
103       │MT-Level                     │MT-Safe                      │
104       └─────────────────────────────┴─────────────────────────────┘
105

SEE ALSO

107       bsmconv(1M), audit(2), attributes(5)
108

NOTES

110       The functionality described in this man page is available only  if  the
111       Solaris  Auditing  has been enabled.  See bsmconv(1M) for more informa‐
112       tion.
113
114
115
116SunOS 5.11                        16 Apr 2008                      getaudit(2)
Impressum