AUDIT_LOG_ACCT_MESSAGE(3)
π AUDIT_LOG_ACCT_MESSAGE π
okay bestie, so this is a page from the Linux Audit API β section 3, library functions, iykyk β and it's literally called audit_log_acct_message. Say it with me: audit_log_acct_message. Slay.
β¨ NAME β¨
audit_log_acct_message β log a user account message π«Ά
β¨ SYNOPSIS β¨
#include <libaudit.h>
int audit_log_acct_message(int audit_fd,
int type,
const char *pgname,
const char *op,
const char *name,
unsigned int id,
const char *host,
const char *addr,
const char *tty,
int result);
β¨ DESCRIPTION β¨
okay so here's the vibe: this function logs a message to the audit system using a predefined message format. That's it, that's the whole thing. And you should be using it for all your account manipulation operations β like, every single one, no exceptions, periodt. π
The function parameters are giving:
audit_fdβ the fd you got back fromaudit_open. yes, that one. πtypeβ the type of message:AUDIT_USER_CHAUTHTOKfor changing any account attributes. that's the one it wants here. πΈpgnameβ the program's name. if you passNULLit will attempt to figure it out for you. cute of it honestly. π¦opβ the operation. like, for real for real:"adding-user","changing-finger-info","deleting-group". π and listen β this value should have a dash or underscore between the words so that report parsers group them together. don't be out here writing"adding user"with a space, the parsers will simply not group it and it will be a whole mess. πnameβ the user's account or group name. if it's not available, useNULL. no cap. πidβ the uid or gid that the operation is being performed on. if the user is unknown, pass a-1and fill in thenameparameter instead. note bestie: this is used only when user isNULL. πhostβ the hostname if known. if not available, pass aNULL.addrβ the network address of the user. if not available, pass aNULL.ttyβ the tty of the user. ifNULLit will attempt to figure it out. main character behavior honestly. β¨resultβ1is "success" and0is "failed". binary queen. β
β¨ RETURN VALUE β¨
It returns the sequence number, which is > 0 on success or <= 0 on error. so like, positive = we ate, non-positive = we did not. π
β¨ ERRORS β¨
This function returns -1 on failure. go examine errno for more info, that's where the tea is. π
β¨ SEE ALSO β¨
audit_log_user_message(3)audit_log_user_comm_message(3)audit_log_user_avc_message(3)audit_log_semanage_message(3)
β¨ AUTHOR β¨
Steve Grubb β the icon, the legend, the moment. π§
and that's the whole page bestie!! brought to you by Red Hat, dated Nov 2015, and it's a section 3 Linux Audit API moment. go log those account messages responsibly, ily, bye πβ¨π
π¦ where this page comes from
- arch rolling: audit 4.2.1-1 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- centos-stream 10: audit-libs-devel 4.2.1-3.el10 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- nixpkgs unstable: audit 4.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms