AUDIT_LOG_USER_MESSAGE(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_LOG_USER_MESSAGE(3) ✨

the Linux Audit API but make it cute πŸŽ€ β€” this is audit_log_user_message, bestie, and she is that girl.


πŸ’– NAME πŸ’–

audit_log_user_message β€” log a general user message πŸ“


🌸 SYNOPSIS 🌸

#include <libaudit.h>

int audit_log_user_message(int audit_fd, int type, const char *message, const char *hostname, const char *addr, const char *tty, int result)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. This function logs a message to the audit system using a predefined message format. Periodt.

Who's it for? All ELF console apps that do not manipulate accounts or groups. That's the vibe check. πŸ‘‘

But bestie, listen β€” if your app is written in Python or some other interpreter? Then you do NOT use this one. Use the audit_log_user_comm_message function instead. No cap, it's a whole different function for a whole different situation.

The function parameters are as follows, and I need you to know every single one πŸ’…:

  • audit_fd β€” the fd returned by audit_open
  • type β€” type of message, ex: AUDIT_USYS_CONFIG, AUDIT_USER_LOGIN
  • message β€” the message text being sent
  • hostname β€” the hostname if known, NULL if unknown
  • addr β€” the network address of the user, NULL if unknown
  • tty β€” the tty of the user, if NULL will attempt to figure out
  • result β€” 1 is "success" and 0 is "failed"

🌈 RETURN VALUE 🌈

She returns the sequence number, which is > 0 on success or <= 0 on error. slay ✨


πŸ’€ ERRORS πŸ’€

This function returns -1 on failure. Examine errno for more info. (yes, you have to actually look at it, i'm sorry 😭)


πŸ‘‘ SEE ALSO πŸ‘‘


🫢 AUTHOR 🫢

Steve Grubb β€” the icon, the moment, the legend πŸ’–


and that's the whole page, bestie 🧚 this one came from Red Hat, dated July 2016, and honestly it ate. go forth and log responsibly πŸŒŸπŸ“