AUDIT_SET_FAILURE(3)

πŸ“¦
version 4.2.1 Β· 2 versions
, in alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– AUDIT_SET_FAILURE(3) πŸ’–

okay so bestie, this is a page from the Linux Audit API β€” the AUDIT_SET_FAILURE(3) one β€” and honestly? it's short, it's sweet, and it's lowkey about what your kernel does when the audit party gets too full. let's get into it πŸŽ€


✨ NAME ✨

audit_set_failure β€” set the audit failure flag. that's it, that's the name, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include <libaudit.h>

int audit_set_failure(intfd,uint32_t"failure);"

yes the signature is giving cursed, we don't talk about it, just vibe with it 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, audit_set_failure sets the action that the kernel will perform when the backlog limit is reached β€” or when it hits an error and literally cannot proceed. it's the "what do we do now bestie" switch. πŸ”₯

the possible values are:

  • 0 - AUDIT_FAIL_SILENT β€” do nothing, report nothing, skip logging the record, and just continue. silence. iconic ghost behaviour πŸ’€
  • 1 - AUDIT_FAIL_PRINTK β€” [default] β€” log the audit record using printk, which will cause subsequent events to get written to syslog. the responsible one, the main character πŸ‘‘
  • 2 - AUDIT_FAIL_PANIC β€” call the panic function. this would be used to prevent use of the machine upon loss of audit events. yeah. it panics. on purpose. not me being dramatic, that's literally the spec 😭
okay fr fr, if you pick 2 you are choosing violence on purpose β€” it's there so the machine stops being usable if audit events get lost. not a casual setting, bestie, that's a whole commitment. 🚨

🌈 RETURN VALUE 🌈

the return value is <= 0 on error, otherwise it's the netlink sequence id number. and ngl, this function can have any error that sendto would encounter β€” so if sendto can be weird about it, so can this. πŸ’œ


⭐ SEE ALSO ⭐

iykyk, go read those next 🧚


πŸ“ AUTHOR πŸ“

Steve Grubb β€” thank you king 🫢


and that's the whole page bestie!! this one came from Red Hat, dated June 2015, so it's a certified classic from the Linux Audit API era. slay, stay audited, and don't set it to panic unless you mean it πŸ’–βœ¨πŸŽ€