]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - contrib/openbsm/libbsm/au_notify.3
- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
[FreeBSD/releng/10.3.git] / contrib / openbsm / libbsm / au_notify.3
1 .\"-
2 .\" Copyright (c) 2004-2009 Apple Inc.
3 .\" Copyright (c) 2015 Christian Brueffer
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the author nor the names of
15 .\"    its contributors may be used to endorse or promote products derived
16 .\"    from this software without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .Dd July 29, 2015
31 .Dt AU_NOTIFY 3
32 .Os
33 .Sh NAME
34 .Nm au_get_state ,
35 .Nm au_notify_initialize ,
36 .Nm au_notify_terminate
37 .Nd "audit event notification"
38 .Sh LIBRARY
39 .Lb libbsm
40 .Sh SYNOPSIS
41 .In bsm/libbsm.h
42 .Ft int
43 .Fn au_get_state "void"
44 .Ft uint32_t
45 .Fn au_notify_initialize "void"
46 .Ft int
47 .Fn au_notify_terminate "void"
48 .Sh DESCRIPTION
49 The
50 .Nm au_notify
51 audit notification API tracks audit state in a form permitting efficient
52 update, avoiding frequent system calls to check the kernel audit state.
53 It is implemented only for Darwin/Mac OS X.
54 .Pp
55 The
56 .Fn au_get_state
57 function provides a lightweight way to check whether or not auditing is
58 enabled.
59 If a client wants to use this function to determine whether an entire
60 series of audit calls should be made -- as in the common case of a caller
61 building a set of tokens, then writing them -- it should cache the audit
62 status in a local variable.
63 This function always returns the current state of auditing.
64 If audit notification has not already been initialized by calling
65 .Fn au_notify_initialize
66 it will be automatically initialized on the first call of
67 this function.
68 .Pp
69 The
70 .Fn au_notify_initialize
71 function initializes audit notification.
72 .Pp
73 The
74 .Fn au_notify_terminate
75 function cancels audit notification and frees the resources associated with it.
76 Responsible code that no longer needs to use
77 .Fn au_get_state
78 should call this function.
79 .Sh RETURN VALUES
80 If no error occurred the
81 .Fn au_get_state
82 function returns
83 .Dv AUC_NOAUDIT
84 if auditing is disabled or suspended, and
85 .Dv AUC_AUDITING
86 if auditing is enabled and active.
87 Otherwise, the function can return any of the errno values defined for
88 .Xr setaudit 2 ,
89 or
90 .Dv AU_UNIMPL
91 if audit does not appear to be supported by the system.
92 .Pp
93 The
94 .Fn au_notify_initialize
95 function returns 0 on success,
96 .Dv AU_UNIMPL
97 if audit does not appear to be supported by the system,
98 or one of the status codes defined in
99 .In notify.h
100 on Mac OS X to indicate the error.
101 .Pp
102 The
103 .Fn au_notify_terminate
104 function returns 0 on success, or \-1 on failure.
105 .Sh SEE ALSO
106 .Xr libbsm 3 ,
107 .Xr notify 3 (Mac OS X)
108 .Sh HISTORY
109 The OpenBSM implementation was created by McAfee Research, the security
110 division of McAfee Inc., under contract to Apple Computer, Inc., in 2004.
111 It was subsequently adopted by the TrustedBSD Project as the foundation for
112 the OpenBSM distribution.
113 .Sh AUTHORS
114 This software was created by
115 .An Apple Computer, Inc .
116 .Pp
117 The Basic Security Module (BSM) interface to audit records and audit event
118 stream format were defined by Sun Microsystems.