AUDIT(2)
π AUDIT(2) π β the audit girlies' system call manual
okay bestie, so this is the audit page from the System Calls Manual, and it's literally the moment you get to β¨commit a BSM audit record to the audit logβ¨. no cap, it's giving security main character energy. let's go π«Ά
β¨ NAME β¨
audit β commit BSM audit record to audit log
πΈ SYNOPSIS πΈ
#include <bsm/audit.h>
int
audit(const char *record, u_int length);
π¦ DESCRIPTION π¦
so the audit() system call submits a completed BSM audit record to the system audit log. that's it, that's the vibe. iconic behavior π
the record argument is a pointer to the specific event to be recorded, and length is the size in bytes of the data to be written. literally just "here's the record, here's how big it is" and the kernel takes it from there π
β RETURN VALUES β
upon successful completion, the value 0 is returned π otherwise the value -1 is returned and the global variable errno is set to indicate the error. so like, check your errno, bestie, she's always trying to tell you something π
π₯ ERRORS π₯
the audit() system call will fail and the data never written if:
[EFAULT]β therecordargument is beyond the allocated address space of the process. π like girl you're pointing at nothing.[EINVAL]β the token ID is invalid orlengthis larger thanMAXAUDITDATA. too much, babe, the limit is the limit.[EPERM]β the process does not have sufficient permission to complete the operation. no permission, no entry π
π SEE ALSO π
auditon(2), getaudit(2), getaudit_addr(2), getauid(2), setaudit(2), setaudit_addr(2), setauid(2), libbsm(3)
go read them, they're the friend group π«Ά
π 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 glow-up arc, fr fr β¨
π AUTHORS π
this software was created by McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer Inc. additional authors include Wayne Salamon, Robert Watson, and SPARTA Inc.
the Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. legends, honestly π
this manual page was written by Tom Rhodes <trhodes@FreeBSD.org>. thank you for your service, king π
π BUGS π
the FreeBSD kernel does not fully validate that the argument passed is syntactically valid BSM. submitting invalid audit records may corrupt the audit log.
okay so this is the part where we get serious for one sec β submitting invalid audit records may corrupt the audit log, and the kernel isn't gonna hold your hand about it. not me being dramatic, it's literally in the manpage π be careful.
Debian Β· April 19, 2005 Β· that's the source, version and date of this page, and that's the whole manual bestie β stay audited, stay slay, bye π ππ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2005 Tom Rhodes
- Copyright (c) 2005 Robert N. M. Watson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms