AUDIT_REQUEST_STATUS(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_REQUEST_STATUS(3) ✨

okay so bestie, we're in the Linux Audit API today and this one is genuinely a little baddie πŸ’… it lives in section 3 of the manual, and it's about asking the kernel to spill the tea about your audit setup. yes ma'am.


🌸 NAME 🌸

audit_request_status β€” request the status of the audit system. like, "hey kernel, how we doin?" and it actually answers 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <libaudit.h>

int audit_request_status(int fd);"

πŸ’– DESCRIPTION πŸ’–

so audit_request_status basically walks up to the kernel and is like "pls send me a status structure" β€” and the kernel is like "say less". it requests that the kernel send a status structure describing the various settings, over the descriptor you hand it in fd.

and the structure it sends back? it's the audit_status struct, and it looks like this, no cap:

struct audit_status {
   __u32   mask;           /* Bit mask for valid entries */
   __u32   enabled;        /* 1 = enabled, 0 = disabled */
   __u32   failure;        /* Failure-to-log action */
   __u32   pid;            /* pid of auditd process */
   __u32   rate_limit;     /* messages rate limit (per second) */
   __u32   backlog_limit;  /* waiting messages limit */
   __u32   lost;           /* messages lost */
   __u32   backlog;        /* messages waiting in queue */
};

look at her. eight fields. iconic. ✨


πŸ¦‹ RETURN VALUE πŸ¦‹

so the return value is <= 0 on error β€” yes, zero or less means something went wrong, watch out for that one bestie 😭 β€” otherwise it's the netlink sequence id number. and ngl, this function can have any error that sendto would encounter, so whatever sendto can throw at you, this can too. it's giving "inherited the whole family's problems" πŸ’€


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Steve Grubb πŸ’œ (yes, THE Steve Grubb, we stan)


and that's the whole page, bestie!! this one came from Red Hat, back in Oct 2006, and it's still out here doing its thing. go get that status, queen. slay πŸŽ€βœ¨πŸ¦‹πŸ’