AUDIT_CAN_CONTROL(3)

πŸ’– AUDIT_CAN_CONTROL πŸ’–

ok so bestie, welcome to the Linux Audit API section 3 era of your life 🌸 this is the page for audit_can_control, audit_can_write, and audit_can_read β€” the lil trio that tells you whether your process can do audit stuff. vibe check for capabilities, basically ✨


πŸŽ€ NAME πŸŽ€

audit_can_control, audit_can_write, audit_can_read β€” test audit related capabilities πŸ•΅οΈβ™€οΈ


✨ SYNOPSIS ✨

#include <libaudit.h>

int audit_can_control(void);
int audit_can_write(void);
int audit_can_read(void);

like, three functions, no arguments, all vibes πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

okay so here's the tea, bestie β˜•

  • audit_can_control() returns 1 if the calling process possesses the CAP_AUDIT_CONTROL capability, otherwise 0. she's asking "can I control the audit system??" πŸ‘‘
  • audit_can_write() returns 1 if CAP_AUDIT_WRITE is available. can you write to the audit log, or nah πŸ’Œ
  • audit_can_read() returns 1 if CAP_AUDIT_READ is present. reading the audit log is main character energy fr πŸ“–βœ¨
🫢 important caveat bestie: when libcap-ng support is not available these functions return 1 only when the effective UID is 0. so no libcap-ng = it's just doing a lil root check, periodt. no cap.

⭐ RETURN VALUE ⭐

These functions return 1 when the capability is present and 0 otherwise. that's it. that's the whole range. iconic simplicity tbh πŸ’€


🌈 SEE ALSO 🌈

go read that one next, iykyk 🧚


πŸ’œ AUTHOR πŸ’œ

Steve Grubb πŸ’–


and that's a wrap on the July 2025 edition from Red Hat 🌸 thanks for reading bestie, now go check ur capabilities πŸŽ€βœ¨πŸ’