1ca0716f5SRobert Watson.\"- 24bd0c025SRobert Watson.\" Copyright (c) 2005-2006 Robert N. M. Watson 3ca0716f5SRobert Watson.\" All rights reserved. 4ca0716f5SRobert Watson.\" 5ca0716f5SRobert Watson.\" Redistribution and use in source and binary forms, with or without 6ca0716f5SRobert Watson.\" modification, are permitted provided that the following conditions 7ca0716f5SRobert Watson.\" are met: 8ca0716f5SRobert Watson.\" 1. Redistributions of source code must retain the above copyright 9ca0716f5SRobert Watson.\" notice, this list of conditions and the following disclaimer. 10ca0716f5SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 11ca0716f5SRobert Watson.\" notice, this list of conditions and the following disclaimer in the 12ca0716f5SRobert Watson.\" documentation and/or other materials provided with the distribution. 13ca0716f5SRobert Watson.\" 14ca0716f5SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15ca0716f5SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16ca0716f5SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17ca0716f5SRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18ca0716f5SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19ca0716f5SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20ca0716f5SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21ca0716f5SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22ca0716f5SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23ca0716f5SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24ca0716f5SRobert Watson.\" SUCH DAMAGE. 25ca0716f5SRobert Watson.\" 264bd0c025SRobert Watson.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_control.3#5 $ 27ca0716f5SRobert Watson.\" 28ca0716f5SRobert Watson.Dd April 19, 2005 29ca0716f5SRobert Watson.Dt AU_CONTROL 3 30ca0716f5SRobert Watson.Os 31ca0716f5SRobert Watson.Sh NAME 32ca0716f5SRobert Watson.Nm setac , 33ca0716f5SRobert Watson.Nm endac , 34ca0716f5SRobert Watson.Nm getacdir , 35ca0716f5SRobert Watson.Nm getacmin , 364bd0c025SRobert Watson.Nm getacfilesz , 37ca0716f5SRobert Watson.Nm getacflg , 38bb97b418SRobert Watson.Nm getacna , 39bb97b418SRobert Watson.Nm getacpol , 40bb97b418SRobert Watson.Nm au_poltostr 41bb97b418SRobert Watson.Nm au_strtopol 42ca0716f5SRobert Watson.Nd "Look up information from the audit_control database" 43ca0716f5SRobert Watson.Sh LIBRARY 44ca0716f5SRobert Watson.Lb libbsm 45ca0716f5SRobert Watson.Sh SYNOPSIS 46ca0716f5SRobert Watson.In libbsm.h 47ca0716f5SRobert Watson.Ft void 48ca0716f5SRobert Watson.Fn setac "void" 49ca0716f5SRobert Watson.Ft void 50ca0716f5SRobert Watson.Fn endac "void" 51ca0716f5SRobert Watson.Ft int 52ca0716f5SRobert Watson.Fn getacdir "char *name" "int len" 53ca0716f5SRobert Watson.Ft int 54ca0716f5SRobert Watson.Fn getacmin "int *min_val" 55ca0716f5SRobert Watson.Ft int 564bd0c025SRobert Watson.Fn getacfilesz "size_t *size_val" 574bd0c025SRobert Watson.Ft int 58ca0716f5SRobert Watson.Fn getacflg "char *auditstr" "int len" 59ca0716f5SRobert Watson.Ft int 60ca0716f5SRobert Watson.Fn getacna "char *auditstr" "int len" 61bb97b418SRobert Watson.Ft int 62bb97b418SRobert Watson.Fn getacpol "char *auditstr" "size_t len" 63bb97b418SRobert Watson.Ft ssize_t 64bb97b418SRobert Watson.Fn au_poltostr "long policy" "size_t maxsize" "char *buf" 65bb97b418SRobert Watson.Ft int 66bb97b418SRobert Watson.Fn au_strtopol "const char *polstr" "long *policy" 67ca0716f5SRobert Watson.Sh DESCRIPTION 68ca0716f5SRobert WatsonThese interfaces may be used to look up information from the 69ca0716f5SRobert Watson.Xr audit_control 5 70ca0716f5SRobert Watsondatabase, which contains various audit-related administrative parameters. 71ca0716f5SRobert Watson.Pp 72ca0716f5SRobert Watson.Fn setac 73ca0716f5SRobert Watsonresets the database iterator to the beginning of the database; see the 74ca0716f5SRobert WatsonBUGS section for more information. 75ca0716f5SRobert Watson.Pp 76ca0716f5SRobert Watson.Fn sendac 77ca0716f5SRobert Watsoncloses the 78ca0716f5SRobert Watson.Xr audit_control 5 79ca0716f5SRobert Watsondatabase. 80ca0716f5SRobert Watson.Pp 81ca0716f5SRobert Watson.Fn getacdir 8223bf6e20SRobert Watsonreturns the name of the directory where log data is stored via the passed 83ca0716f5SRobert Watsoncharacter buffer 84ca0716f5SRobert Watson.Va name 85ca0716f5SRobert Watsonof length 86ca0716f5SRobert Watson.Va len . 87ca0716f5SRobert Watson.Pp 88ca0716f5SRobert Watson.Fn getacmin 89ca0716f5SRobert Watsonreturns the minimum free disk space for the audit log target file system via 90ca0716f5SRobert Watsonthe passed 91ca0716f5SRobert Watson.Va min_val 92ca0716f5SRobert Watsonvariable. 93ca0716f5SRobert Watson.Pp 944bd0c025SRobert Watson.Fn getacfilesz 954bd0c025SRobert Watsonreturns the audit trail rotation size in the passed size_t buffer 964bd0c025SRobert Watson.Fa size_val . 974bd0c025SRobert Watson.Pp 98ca0716f5SRobert Watson.Fn getacflg 99ca0716f5SRobert Watsonreturns the audit system flags via the the passed character buffer 100ca0716f5SRobert Watson.Va auditstr 101ca0716f5SRobert Watsonof length 102ca0716f5SRobert Watson.Va len . 103ca0716f5SRobert Watson.Pp 104ca0716f5SRobert Watson.Fn getacna 105ca0716f5SRobert Watsonreturns the non-attributable flags via the passed character buffer 106ca0716f5SRobert Watson.Va auditstr 107ca0716f5SRobert Watsonof length 108ca0716f5SRobert Watson.Va len . 109bb97b418SRobert Watson.Pp 110bb97b418SRobert Watson.Fn getacpol 111bb97b418SRobert Watsonreturns the audit policy flags via the passed character buffer 112bb97b418SRobert Watson.Va auditstr 113bb97b418SRobert Watsonof length 114bb97b418SRobert Watson.Va len . 115bb97b418SRobert Watson.Pp 116bb97b418SRobert Watson.Fn au_poltostr 117bb97b418SRobert Watsonconverts a numeric audit policy mask, 118bb97b418SRobert Watson.Va policy , 119bb97b418SRobert Watsonvalue to a string in the passed character buffer 120bb97b418SRobert Watson.Va buf 121bb97b418SRobert Watsonof lenth 122bb97b418SRobert Watson.Va maxsize . 123bb97b418SRobert Watson.Pp 124bb97b418SRobert Watson.Fn au_strtopol 125bb97b418SRobert Watsonconverts an audit policy flags string, 126bb97b418SRobert Watson.Va polstr , 127bb97b418SRobert Watsonto a numeric audit policy mask returned via 128bb97b418SRobert Watson.Va policy . 129ca0716f5SRobert Watson.Sh RETURN VALULES 130ca0716f5SRobert Watson.Fn getacdir , 131ca0716f5SRobert Watson.Fn getacmin , 132ca0716f5SRobert Watson.Fn getacflg , 133bb97b418SRobert Watson.Fn getacna , 134bb97b418SRobert Watson.Fn getacpol , 135ca0716f5SRobert Watsonand 136bb97b418SRobert Watson.Fn au_strtopol 137ca0716f5SRobert Watsonreturn 0 on success, or a negative value on failure, along with error 138ca0716f5SRobert Watsoninformation in 139ca0716f5SRobert Watson.Va errno . 140bb97b418SRobert Watson.Pp 141bb97b418SRobert Watson.Fn au_poltostr 142bb97b418SRobert Watsonreturns a string length of 0 or more on success, or a negative value on 143bb97b418SRobert Watsonif there is a failure. 144bb97b418SRobert Watson.Pp 145ca0716f5SRobert WatsonFunctions that return a string value will return a failure if there is 146ca0716f5SRobert Watsoninsufficient room in the passed character buffer for the full string. 147ca0716f5SRobert Watson.Sh SEE ALSO 148ca0716f5SRobert Watson.Xr libbsm 3 , 149ca0716f5SRobert Watson.Xr audit_control 5 150ca0716f5SRobert Watson.Sh AUTHORS 151ca0716f5SRobert WatsonThis software was created by Robert Watson, Wayne Salamon, and Suresh 152ca0716f5SRobert WatsonKrishnaswamy for McAfee Research, the security research division of McAfee, 153ca0716f5SRobert WatsonInc., under contract to Apple Computer, Inc. 154ca0716f5SRobert Watson.Pp 155ca0716f5SRobert WatsonThe Basic Security Module (BSM) interface to audit records and audit event 156ca0716f5SRobert Watsonstream format were defined by Sun Microsystems. 157ca0716f5SRobert Watson.Sh HISTORY 158ca0716f5SRobert WatsonThe OpenBSM implementation was created by McAfee Research, the security 159ca0716f5SRobert Watsondivision of McAfee Inc., under contract to Apple Computer, Inc., in 2004. 160ca0716f5SRobert WatsonIt was subsequently adopted by the TrustedBSD Project as the foundation for 161ca0716f5SRobert Watsonthe OpenBSM distribution. 162ca0716f5SRobert Watson.Sh BUGS 163ca0716f5SRobert WatsonThese routines cannot currently distinguish between an entry not being found 164ca0716f5SRobert Watsonand an error accessing the database. 165ca0716f5SRobert WatsonThe implementation should be changed to return an error via 166ca0716f5SRobert Watson.Va errno 167ca0716f5SRobert Watsonwhen 168ca0716f5SRobert Watson.Dv NULL 169ca0716f5SRobert Watsonis returned. 170ca0716f5SRobert Watson.Sh BUGS 171ca0716f5SRobert WatsonThere is no reason for the 172ca0716f5SRobert Watson.Fn setac 173ca0716f5SRobert Watsoninterface to be exposed as part of the public API, as it is called implicitly 174ca0716f5SRobert Watsonby other access functions and iteration is not supported. 175ca0716f5SRobert Watson.Pp 176ca0716f5SRobert WatsonThese interfaces inconsistently return various negative values depending on 177ca0716f5SRobert Watsonthe failure mode, and do not always set 178ca0716f5SRobert Watson.Va errno 179ca0716f5SRobert Watsonon failure. 180