OPENPAM_LOG(3)
β¨ 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 variableopenpam_debugis set to a non-zero value, in which case they get logged with asyslog(3)priority ofLOG_DEBUGπ₯ So ifopenpam_debugis 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 asyslog(3)priority ofLOG_INFO.PAM_LOG_NOTICEβ Messages relating to non-fatal errors π These get logged with asyslog(3)priority ofLOG_NOTICE.PAM_LOG_ERRORβ Messages relating to serious errors ππ These get logged with asyslog(3)priority ofLOG_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: rememberPAM_LOG_DEBUGmessages are normally not logged unlessopenpam_debugis 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
- freebsd 14.5: base 14.5
- nixos 26.05: openpam 20230627
- nixpkgs unstable: openpam 20230627
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms