GETAUID(2)

πŸ“¦
version 1.1 Β· 2 versions
, in nixos 26.05, nixpkgs unstable

πŸ’– GETAUID(2) β€” like, the audit session ID getter, bestie πŸ’–

okay so this is from the System Calls Manual, section 2, and it's literally called getauid πŸŽ€ β€” yes that's the whole name, we're keeping it.


✨ NAME ✨

getauid β€” retrieve audit session ID πŸ•΅οΈβ™€οΈπŸ’…


🌸 SYNOPSIS 🌸

#include <bsm/audit.h>

int
getauid(au_id_t *auid);

like, that's it. that's the whole vibe. πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

okay so getauid() is a system call, right, and what it does is it retrieves the active audit session ID for the current process β€” and it hands it back to you through the au_id_t that auid points at. main character energy fr fr πŸ‘‘

and like… here's the thing bestie: this system call requires an appropriate privilege to complete. so if you don't have the right permissions, it's not gonna happen. no cap. πŸ™ˆ


🫢 RETURN VALUES 🫢

the way that this works is:

  • if everything goes slay, the value 0 is returned ✨
  • and if it doesn't?? the value -1 is returned, and the global variable errno gets set to indicate the error 😭

periodt.


πŸ”₯ ERRORS πŸ”₯

the getauid() function will fail if:

  • [EFAULT] β€” a failure occurred while data transferred from the kernel failed πŸ’€ like the transfer just did not go through
  • [EPERM] β€” the process does not have sufficient permission to complete the operation πŸ™…β€β™€οΈ nope, not allowed, no entry

🌈 SEE ALSO 🌈

audit(2), auditon(2), getaudit(2), getaudit_addr(2), setaudit(2), setaudit_addr(2), setauid(2), libbsm(3)

go read those too, they're all in the same friend group πŸ’–


πŸŽ€ HISTORY πŸŽ€

so, storytime 🧚 The OpenBSM implementation was created by McAfee Research β€” that's the security division of McAfee Inc. β€” under contract to Apple Computer Inc. in 2004. and then it was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. iconic honestly ⭐


πŸ‘‘ AUTHORS πŸ‘‘

This software was created by McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer Inc. Additional authors include Wayne Salamon, Robert Watson, and SPARTA Inc. 🫢

The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. 🌞

This manual page was written by Robert Watson <rwatson@FreeBSD.org> πŸ’Œ


okay that's the whole page bestie, ily, go get that audit session ID πŸ’…βœ¨

Debian 🌸 April 19, 2005 πŸŽ€ β€” that's the source and the date, mwah, bye!! πŸ’–πŸ¦‹

πŸ“¦ where this page comes from