1GET_AUDITFAIL_ACTION(3) Linux Programmer's Manual GET_AUDITFAIL_ACTION(3)
2
3
4
6 get_auditfail_action - Get failure_action tunable value
7
9 #include <libaudit.h>
10
11
12 int get_auditfail_action (int *failmode);
13
14
16 This function gets the failure_action tunable value stored in
17 /etc/libaudit.conf. get_auditfail_action should be called after an au‐
18 dit_open call returns an error to see what action the admin prefers.
19
20
21 The failure_action value found in /etc/libaudit.conf is copied into the
22 failmode argument upon function return. This value should then be used
23 by the calling application to determine what action should be taken
24 when the audit subsystem is unavailable.
25
26
28 Upon success, get_auditfail_action returns a zero, and the failmode ar‐
29 gument will hold the failure_action value. The possible values for
30 failure_action are: FAIL_IGNORE (0), FAIL_LOG (1), and FAIL_TERMINATE
31 (2). Upon failure, get_auditfail_action returns a return code of one.
32
33
35 An error is returned if there is an error reading /etc/libaudit.conf or
36 if the failure_action tunable is not found in the file.
37
38
40 /* Sample code */
41 auditfail_t failmode;
42
43 if ((fd = audit_open() ) < 0 ) {
44 fprintf (stderr, "Cannot open netlink audit socket");
45
46 /* Get the failure_action */
47 if ((rc = get_auditfail_action(&failmode)) == 0) {
48 if (failmode == FAIL_LOG)
49 fprintf (stderr, "Audit subsystem unavailable");
50 else if (failmode == FAIL_TERMINATE)
51 exit (1);
52 /* If failmode == FAIL_IGNORE, do nothing */
53 }
54 }
55
56
58 audit_open(3), auditd(8).
59
60
62 Lisa M. Smith.
63
64
65
66Linux 2.7 2006-7-10 GET_AUDITFAIL_ACTION(3)