]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/openbsm/libbsm/au_control.3
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / openbsm / libbsm / au_control.3
1 .\"-
2 .\" Copyright (c) 2005-2006 Robert N. M. Watson
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
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.
13 .\"
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
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_control.3#11 $
27 .\"
28 .Dd April 19, 2005
29 .Dt AU_CONTROL 3
30 .Os
31 .Sh NAME
32 .Nm setac ,
33 .Nm endac ,
34 .Nm getacdir ,
35 .Nm getacmin ,
36 .Nm getacexpire ,
37 .Nm getacfilesz ,
38 .Nm getacflg ,
39 .Nm getacna ,
40 .Nm getacpol ,
41 .Nm au_poltostr ,
42 .Nm au_strtopol
43 .Nd "look up information from the audit_control database"
44 .Sh LIBRARY
45 .Lb libbsm
46 .Sh SYNOPSIS
47 .In bsm/libbsm.h
48 .Ft void
49 .Fn setac void
50 .Ft void
51 .Fn endac void
52 .Ft int
53 .Fn getacdir "char *name" "int len"
54 .Ft int
55 .Fn getacmin "int *min_val"
56 .Ft int
57 .Fn getacexpire "int *andflg, time_t *age, size_t *size"
58 .Ft int
59 .Fn getacfilesz "size_t *size_val"
60 .Ft int
61 .Fn getacflg "char *auditstr" "int len"
62 .Ft int
63 .Fn getacna "char *auditstr" "int len"
64 .Ft int
65 .Fn getacpol "char *auditstr" "size_t len"
66 .Ft ssize_t
67 .Fn au_poltostr "int policy" "size_t maxsize" "char *buf"
68 .Ft int
69 .Fn au_strtopol "const char *polstr" "int *policy"
70 .Sh DESCRIPTION
71 These interfaces may be used to look up information from the
72 .Xr audit_control 5
73 database, which contains various audit-related administrative parameters.
74 .Pp
75 The
76 .Fn setac
77 function
78 resets the database iterator to the beginning of the database; see the
79 .Sx BUGS
80 section for more information.
81 .Pp
82 The
83 .Fn endac
84 function
85 closes the
86 .Xr audit_control 5
87 database.
88 .Pp
89 The
90 .Fn getacdir
91 function
92 returns the name of the directory where log data is stored via the passed
93 character buffer
94 .Fa name
95 of length
96 .Fa len .
97 .Pp
98 The
99 .Fn getacmin
100 function
101 returns the minimum free disk space for the audit log target file system via
102 the passed
103 .Fa min_val
104 variable.
105 .Pp
106 The
107 .Fn getacexpire
108 function 
109 returns the audit trail file expiration parameters in the passed
110 .Vt int
111 buffer
112 .Fa andflg ,
113 .Vt time_t
114 buffer
115 .Fa age
116 and 
117 .Vt size_t
118 buffer
119 .Fa size .
120 If the parameter is not specified in the
121 .Xr audit_control 5
122 file it is set to zero.
123 .Pp
124 The
125 .Fn getacfilesz
126 function
127 returns the audit trail rotation size in the passed
128 .Vt size_t
129 buffer
130 .Fa size_val .
131 .Pp
132 The
133 .Fn getacflg
134 function
135 returns the audit system flags via the the passed character buffer
136 .Fa auditstr
137 of length
138 .Fa len .
139 .Pp
140 The
141 .Fn getacna
142 function
143 returns the non-attributable flags via the passed character buffer
144 .Fa auditstr
145 of length
146 .Fa len .
147 .Pp
148 The
149 .Fn getacpol
150 function
151 returns the audit policy flags via the passed character buffer
152 .Fa auditstr
153 of length
154 .Fa len .
155 .Pp
156 The
157 .Fn au_poltostr
158 function
159 converts a numeric audit policy mask,
160 .Fa policy ,
161 to a string in the passed character buffer
162 .Fa buf
163 of lenth
164 .Fa maxsize .
165 .Pp
166 The
167 .Fn au_strtopol
168 function
169 converts an audit policy flags string,
170 .Fa polstr ,
171 to a numeric audit policy mask returned via
172 .Fa policy .
173 .Sh RETURN VALULES
174 The
175 .Fn getacdir ,
176 .Fn getacmin ,
177 .Fn getacexpire ,
178 .Fn getacflg ,
179 .Fn getacna ,
180 .Fn getacpol ,
181 and
182 .Fn au_strtopol
183 functions
184 return 0 on success, or a negative value on failure, along with error
185 information in
186 .Va errno .
187 .Pp
188 The
189 .Fn au_poltostr
190 function
191 returns a string length of 0 or more on success, or a negative value on
192 if there is a failure.
193 .Pp
194 Functions that return a string value will return a failure if there is
195 insufficient room in the passed character buffer for the full string.
196 .Sh SEE ALSO
197 .Xr libbsm 3 ,
198 .Xr audit_control 5
199 .Sh HISTORY
200 The OpenBSM implementation was created by McAfee Research, the security
201 division of McAfee Inc., under contract to Apple Computer, Inc., in 2004.
202 It was subsequently adopted by the TrustedBSD Project as the foundation for
203 the OpenBSM distribution.
204 .Sh AUTHORS
205 .An -nosplit
206 This software was created by
207 .An Robert Watson ,
208 .An Wayne Salamon ,
209 and
210 .An Suresh Krishnaswamy
211 for McAfee Research, the security research division of McAfee,
212 Inc., under contract to Apple Computer, Inc.
213 .Pp
214 The Basic Security Module (BSM) interface to audit records and audit event
215 stream format were defined by Sun Microsystems.
216 .Sh BUGS
217 These routines cannot currently distinguish between an entry not being found
218 and an error accessing the database.
219 The implementation should be changed to return an error via
220 .Va errno
221 when
222 .Dv NULL
223 is returned.
224 .Sh BUGS
225 There is no reason for the
226 .Fn setac
227 interface to be exposed as part of the public API, as it is called implicitly
228 by other access functions and iteration is not supported.
229 .Pp
230 These interfaces inconsistently return various negative values depending on
231 the failure mode, and do not always set
232 .Va errno
233 on failure.