AU_CONTROL(3)
π AU_CONTROL(3) β audit_control database lookups, bestie edition π
Library Functions Manual, but make it group-chat. Weβre in AU_CONTROL(3) territory, and these interfaces are here to look things up for you. Slay.
β¨ NAME β¨
okay so the whole squad is: setac, endac, getacdir, getacdist, getacexpire, getacfilesz, getacflg, getachost, getacmin, getacna, getacpol, au_poltostr, and au_strtopol β and their whole thing is looking up information from the audit_control database. No cap.
π LIBRARY π
Basic Security Module Library (libbsm, -lbsm). Iconic. π
π§ SYNOPSIS π§
#include <bsm/libbsm.h>
void
setac(void);
void
endac(void);
int
getacdir(char *name, int len);
int
getacdist(void);
int
getacexpire(int *andflg, time_t *age, size_t *size);
int
getacfilesz(size_t *size_val);
int
getacflg(char *auditstr, int len);
int
getachost(char *auditstr, int len);
int
getacmin(int *min_val);
int
getacna(char *auditstr, int len);
int
getacpol(char *auditstr, size_t len);
int
getacqsize(int *size_val);
ssize_t
au_poltostr(int policy, size_t maxsize, char *buf);
int
au_strtopol(const char *polstr, int *policy);
πΈ DESCRIPTION πΈ
These interfaces may be used to look up information from the audit_control(5) database, which contains various audit-related administrative parameters. Basically your backstage pass to the audit config, bestie. π
setac()β resets the database iterator to the beginning of the database; see theBUGSsection for more information. Yes, this is foreshadowing. πendac()β closes theaudit_control(5)database. Byeee πgetacdir()β returns the name of the directory where log data is stored via the passed character buffernameof lengthlen. Directory reveal, periodt.getacdist()β returns a value that lets you decide whether trail files distribution is turned on or off. The on/off vibe check.getacexpire()β returns the audit trail file expiration parameters in the passedintbufferandflg,time_tbufferage, andsize_tbuffersize. If the parameter is not specified in theaudit_control(5)file, it is set to zero. Zero means zero, bestie.getacfilesz()β returns the audit trail rotation size in the passedsize_tbuffersize_val. Rotation size, served fresh.getacflg()β returns the audit system flags via the passed character bufferauditstrof lengthlen. Flags acquired. π©getachost()β returns the local systemβs audit host information via the passed character bufferauditstrof lengthlen. Local host info, coming right up.getacmin()β returns the minimum free disk space for the audit log target file system via the passedmin_valvariable. Disk-space minimum, handled. π½getacna()β returns the non-attributable flags via the passed character bufferauditstrof lengthlen. Non-attributable flags, very demure.getacpol()β returns the audit policy flags via the passed character bufferauditstrof lengthlen. Policy flags, served.getacqsize()β returns the size of the audit post-commit queue in the passedsize_valbuffer. If the parameter is not specified in theaudit_control(5)file, it is set to-1, indicating that the kernelβs default queue size is being used. So-1is lowkey meaningful here, not just a random little guy.au_poltostr()β converts a numeric audit policy mask,policy, to a string in the passed character bufferbufof lengthmaxsize. Number to string, main character conversion. β¨au_strtopol()β converts an audit policy flags string,polstr, to a numeric audit policy mask returned viapolicy. String to number, reverse slay.
π― RETURN VALUES π―
The getacfilesz(), getacdir(), getacexpire(), getacflg(), getachost(), getacmin(), getacna(), getacpol(), getacqsize(), and au_strtopol() functions return 0 on success, or a negative value on failure, along with error information in errno. So bestie: check errno when things go sideways. π
The au_poltostr() function returns a string length of 0 or more on success, or a negative value if there is a failure. Length zero is still valid, donβt act weird about it.
The getacdist() function returns 1 if trail files distribution is turned on, 0 if it is turned off, or a negative value on failure. Three moods: on, off, and error. π
Functions that return a string value will return a failure if there is insufficient room in the passed character buffer for the full string. So pls size your buffers, bestie β no squeezing the whole fit into a tiny bag. π
π SEE ALSO π
π°οΈ HISTORY π°οΈ
The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer, Inc., in 2004. It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. A whole origin story. π¦
π AUTHORS π
This software was created by Robert Watson, Wayne Salamon, and Suresh Krishnaswamy for McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer, Inc. Respect the architects. π«Ά
The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. Iconic legacy behavior.
π BUGS π
These routines cannot currently distinguish between an entry not being found and an error accessing the database. The implementation should be changed to return an error viaerrnowhenNULLis returned. Yeah. Thatβs the messy part. π
There is no reason for the setac() interface to be exposed as part of the public API, as it is called implicitly by other access functions and iteration is not supported. So itβs giving unnecessary public appearance, honestly.
These interfaces inconsistently return various negative values depending on the failure mode, and do not always set errno on failure. Truly not the consistency slay we wanted. π
okay thatβs the page, bestie β source/version is Debian, the date is December 2, 2016, and the manual is AU_CONTROL(3). byeee ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2005-2006 Robert N. M. Watson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms