AUDIT_SETLOGINUID(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_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 🌈


πŸ‘‘ 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 🧚✨