OPENPAM_LOG(3)

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

✨ openpam_log(3) β€” the cute little syslog gatekeeper ✨

Okay bestie, gather round, because this is openpam_log from the Library Functions Manual and she is lowkey the most useful icon in the whole OpenPAM friend group πŸ’…


🌸 NAME 🌸

openpam_log β€” logs a message through syslog πŸ’– periodt


πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/types.h>
#include <security/pam_appl.h>
#include <security/openpam.h>

void
openpam_log(int level, const char *fmt, ...);

πŸ¦‹ DESCRIPTION πŸ¦‹

So the openpam_log() function logs messages using syslog(3). That's it, that's the vibe. ✨ She's primarily intended for internal use by the library and modules β€” like, she's a backstage queen, not the main character of your app, iykyk 🫢

The level argument tells you how important the message is (a literal vibe check for your log πŸ“Š). Here are the levels, and no, we're not skipping any, there are exactly five:

  • PAM_LOG_LIBDEBUG β€” Debugging messages. For internal use only πŸ™ˆ like don't touch, bestie, that's the library's private business.
  • PAM_LOG_DEBUG β€” Debugging messages too, but these ones are normally not logged unless the global integer variable openpam_debug is set to a non-zero value, in which case they get logged with a syslog(3) priority of LOG_DEBUG πŸ”₯ So if openpam_debug is zero or unset, silence. If it's non-zero, boom, debug messages hit the log.
  • PAM_LOG_VERBOSE β€” Information about the progress of the authentication process, or other non-essential messages 🌈 These get logged with a syslog(3) priority of LOG_INFO.
  • PAM_LOG_NOTICE β€” Messages relating to non-fatal errors πŸ‘€ These get logged with a syslog(3) priority of LOG_NOTICE.
  • PAM_LOG_ERROR β€” Messages relating to serious errors πŸ˜­πŸ’€ These get logged with a syslog(3) priority of LOG_ERR.

The remaining arguments? They're a printf(3) format string plus the corresponding arguments β€” so yes, it's giving very much printf energy, format specifiers and all πŸŽ€

And the detail we all need to know: the openpam_log() function does not modify the value of errno πŸ‘‘ She's respectful. She logs and she leaves your errno exactly where she found it. No cap.

Real talk though: remember PAM_LOG_DEBUG messages are normally not logged unless openpam_debug is non-zero. That's the whole conditional, bestie, don't forget it πŸ’œ

⭐ SEE ALSO ⭐

pam(3), printf(3), syslog(3) β€” go read those too, they're all linked in this little universe 🧚


🌟 STANDARDS 🌟

The openpam_log() function is an OpenPAM extension πŸ’« so yeah, she's extra, but she's our extra.


πŸ’– AUTHORS πŸ’–

Big credit moment, because we always credit the icons 🫢

The openpam_log() function and this manual page were developed for the FreeBSD Project by ThinkSec AS and Network Associates Laboratories, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (β€œCBOSS”), as part of the DARPA CHATS research program. That's a lot of words but every single one of them eats πŸ”₯

The OpenPAM library is maintained by Dag-Erling SmΓΈrgrav <des@des.no> β€” absolute legend behavior πŸ‘‘


πŸ“ cute sign-off πŸ“

This lil beauty comes to you from Debian, dated June 27, 2023, and it's the OPENPAM_LOG(3) page from the Library Functions Manual β€” mwah, love that for us πŸ’‹βœ¨

πŸ“¦ where this page comes from