AUDIT_LOG_SEMANAGE_MESSAGE(3)
π AUDIT_LOG_SEMANAGE_MESSAGE π
okay bestie, so this is a page from the Linux Audit API manual, section 3 (that's the library-calls section, iykyk). The function we're hyping up today is audit_log_semanage_message β yes it's a whole mouthful, yes it slays, and yes we're gonna walk through every single one of those parameters together. grab a snack π
β¨ NAME β¨
audit_log_semanage_message β log a semanage message π
π¦ SYNOPSIS π¦
#include <libaudit.h>
int audit_log_semanage_message(int audit_fd,
int type,
const char *pgname,
const char *op,
const char *name,
unsigned int id,
const char *new_seuser,
const char *new_role,
const char *new_range,
const char *old_seuser,
const char *old_role,
const char *old_range,
const char *host,
const char *addr,
const char *tty,
int result);
that's sixteen parameters, bestie. sixteen. she's extra and we respect it. π
πΈ DESCRIPTION πΈ
So what does she do? This function will log a message to the audit system using a predefined message format. Fr fr, it should be used for all SE Linux user and role manipulation operations β that's literally her whole job.
Now let's break down every single parameter, no skips, no skimming, we are thorough in this house:
audit_fdβ the fd returned byaudit_open(that's the file descriptor your girl hands you, hold onto it)typeβ the type of message:AUDIT_ROLE_ASSIGN/REMOVEfor changing any SE Linux user or role attributespgnameβ the program's nameopβ the operation. Options are"adding-user","adding-role","deleting-user","deleting-role"nameβ the user's account. If it's not available, useNULLidβ the uid that the operation is being performed on. This is used only whennameisNULLnew_seuserβ the new seuser that the login user is gettingnew_roleβ the new_role that the login user is gettingnew_rangeβ the new mls range that the login user is gettingold_seuserβ the old seuser that the login usr hadold_roleβ the old role that the login user hadold_rangeβ the old mls range that the login usr hadhostβ the hostname if knownaddrβ the network address of the userttyβ the tty of the userresultβ1is "success" and0is "failed"
not me pointing out that the original spells it "usr" in the old_* descriptions π we keep the facts exactly as they are, bestie, typos and all, because accuracy is the vibe.
π RETURN VALUE π
She returns the sequence number. That's <green>> 0</green> on success, or <= 0 on error. slay when positive, sad girl hours when not.
π ERRORS π
This function returns -1 on failure. Bestie, when that happens you examine errno for more info. errno is literally telling you what went wrong, so listen to her. π
π SEE ALSO π
audit_log_user_message(3)audit_log_acct_message(3)audit_log_user_avc_message(3)audit_log_user_comm_message(3)
the whole audit girlie squad, go read them too π«Ά
β AUTHOR β
Steve Grubb π (iconic, we thank him for his service)
Red Hat Β· Jan 2012 Β· and that's the whole AUDIT_LOG_SEMANAGE_MESSAGE(3) vibe check, bestie β go log those semanage messages, you're gonna ate β¨π
π
π¦ 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