AUDIT_SETLOGINUID(3)
π AUDIT_SETLOGINUID π
okay bestie, so this is a page from the Linux Audit API and it's literally the manual for audit_setloginuid(3) β the lil function that tells the kernel who's actually logged in. yes, that's the whole vibe. let's go π¦
β¨ NAME β¨
audit_setloginuid β set a program's loginuid value
πΈ SYNOPSIS πΈ
#include <libaudit.h>
int audit_setloginuid(uid_tuid);"
ngl, yes, that trailing " is really in there. we do not touch the code blocks. we just vibe around them π
π« DESCRIPTION π«
So like. This function sets the task attribute loginuid to whatever uid you hand it.
Now here's the tea, and it's important tea: the loginuid value may only be set by programs that have the CAP_AUDIT_CONTROL capability. and what does that normally mean? it means the root account. that's it. that's the gatekeeper. π₯
The loginuid value lives in the task structure and is inherited by child processes β so it follows your whole little process family tree around, no cap.
What's it even for? it's used to track what account a user gained system access with. it's the receipts of "which door did you come in through" πͺβ¨
And the way that every single system entry point program should be doing this?? They should set this value right before changing to the uid of the user granted access, so that audit events are properly attributed to that user. that's the whole assignment bestie, it's giving correct attribution main character energy π
π RETURN VALUE π
This function returns 0 on success and non-zero otherwise. that's it. that's the whole return value. simple. iconic. periodt π
π SEE ALSO π
audit_getloginuid(3)β the getter. the other half of the duo π«Άpam_loginuid(8)
π AUTHOR π
Steve Grubb
okay that's the whole page!! this cutie pie was brought to you by Red Hat, dated Oct 2006, and it's the AUDIT_SETLOGINUID(3) page from the Linux Audit API. mwah π go set those loginuids responsibly, bestie π§β¨
π¦ where this page comes from
- alpine 3.23: audit-doc 4.1.2-r2 Β· LGPL-2.1-or-later
- alpine 3.24: audit-doc 4.1.2-r6 Β· LGPL-2.1-or-later
- 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.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· 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.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· 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
- ubuntu resolute: libaudit-dev 1:4.1.2-1build1 Β· GPL-2.0-only
- ubuntu resolute: libaudit-dev 1:4.1.2-1ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libaudit-dev 1:4.1.2-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms