AU_USER(3)
π AU_USER(3) β the audit_user glow-up guide π
okay so bestie, welcome to AU_USER(3), from the Library Functions Manual β yes we're in the manual pages, yes it's giving study session, but hear me out because this one is actually so useful. β¨
πΈ NAME πΈ
setauuser, endauuser, getauuserent, getauuserent_r, getauusernam, getauusernam_r, au_user_mask, getfauditflags β literally all of these are here to look up information from the audit_user database. that's the whole vibe. π«Ά
π¦ LIBRARY π¦
Basic Security Module Library (libbsm, -lbsm). link it, love it. π
β SYNOPSIS β
#include <bsm/libbsm.h>
void
setauuser(void);
void
endauuser(void);
struct au_user_ent *
getauuserent(void);
struct au_user_ent *
getauuserent_r(struct au_user_ent *u);
struct au_user_ent *
getauusernam(const char *name);
struct au_user_ent *
getauusernam_r(struct au_user_ent *u, const char *name);
int
au_user_mask(char *username, au_mask_t *mask_p);
int
getfauditflags(au_mask_t *usremask, au_mask_t *usrdmask,
au_mask_t *lastmask);
no cap, that's the whole cast of characters. π
π§ DESCRIPTION π§
These interfaces are your little backstage pass to the audit_user(5) database β the file that describes per-user audit configuration. Each audit user entry is described by a au_user_ent, which stores:
- the user's name in
au_nameπ·οΈ - the events to always audit in
au_alwaysπ₯ - the events to never audit in
au_neverπ
okay so now let's meet everybody:
getauuserent()β returns the next user found in theaudit_user(5)database, or the first one if the function hasn't been called yet. it returnsNULLif there are no further records available. it's giving "next slide please". β¨getauusernam()β looks up a user by name.NULLgets returned if no matching class can be found. πsetauuser()β resets the iterator through theaudit_user(5)database, so the next call togetauuserent()starts all the way over from the beginning of the file. rewind era. βͺendauuser()β closes theaudit_user(5)database, if it's open. say bye, bestie. πau_user_mask()β calculates a new session audit mask, handed back to you viamask_p, for the user identified by username. if the user's audit configuration isn't found, it falls back to the default system audit properties returned bygetacflg(3). and the resulting mask may be set via a call tosetaudit(2)or related variants. so iconic of it. πgetfauditflags()β generates a brand new process audit state by combining the audit masks you pass as parameters with the system audit masks. mashup of the year fr fr. π§
π SEE ALSO π
go read those too, i'm not asking, i'm telling you π«Ά
π°οΈ 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. lore drop. πβ¨
π 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.
The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. absolute legends, no notes. π
π BUGS π
okay so this is the messy part, bestie: 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. so until then,NULLis doing double duty and honestly that's on the implementation. π
and that's the page!! π this one came from Debian, dated April 19, 2005 β vintage, honestly. now go audit something, slay, and don't forget to call endauuser() on your way out. πβ¨π¦
π¦ 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