2 .\" Copyright (c) 2005 Robert N. M. Watson
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_mask.3#6 $
33 .Nm getauditflagsbin ,
35 .Nd "convert between string and numeric values of audit masks"
41 .Fn au_preselect "au_event_t event" "au_mask_t *mask_p" "int sorf" "int flag"
43 .Fn getauditflagsbin "char *auditstr" "au_mask_t *masks"
45 .Fn getauditflagschar "char *auditstr" "au_mask_t *masks" "int verbose"
47 These interfaces support processing of an audit mask represented by type
49 including conversion between numeric and text formats, and computing whether
50 or not an event is matched by a mask.
55 calculates whether or not the audit event passed via
57 is matched by the audit mask passed via
61 argument indicates whether or not to consider the event as a success,
64 flag is set, or failure, if the
69 argument accepts additional arguments influencing the behavior of
73 which causes the event to be re-looked up rather than read from the cache,
76 which forces use of the cache.
81 converts a string representation of an audit mask passed via a character
84 returning the resulting mask, if valid, via
90 converts the audit event mask passed via
92 and converts it to a character string in a buffer pointed to by
96 section for more information on how to provide a buffer of
100 flag is set, the class description string retrieved from
102 will be used; otherwise, the two-character class name.
103 .Sh IMPLEMENTATION NOTES
107 makes implicit use of various audit database routines, and may influence
108 the behavior of simultaneous or interleaved processing of those databases by
114 returns 0 on success, or returns \-1 if there is a failure looking up the
115 event type or other database access, in which case
117 will be set to indicate the error.
118 It returns 1 if the event is matched; 0 if not.
120 .Rv -std getauditflagsbin getauditflagschar
125 The OpenBSM implementation was created by McAfee Research, the security
126 division of McAfee Inc., under contract to Apple Computer, Inc., in 2004.
127 It was subsequently adopted by the TrustedBSD Project as the foundation for
128 the OpenBSM distribution.
131 This software was created by
135 .An Suresh Krishnaswamy
136 for McAfee Research, the security research division of McAfee,
137 Inc., under contract to Apple Computer, Inc.
139 The Basic Security Module (BSM) interface to audit records and audit event
140 stream format were defined by Sun Microsystems.
145 may not always be properly set in the event of an error.
148 .Fn getauditflagschar
150 does not provide a way to indicate how long the character buffer is, in order
152 As a result, the caller must always provide a buffer of sufficient length for
153 any possible mask, which may be calculated as three times the number of
154 non-zero bits in the mask argument in the event non-verbose class names are
155 used, and is not trivially predictable for verbose class names.
156 This API should be replaced with a more robust one.