PAM_PROMPT(3)
π PAM_PROMPT(3) β like, the Linux-PAM manual, bestie edition π
okay so real talk, this is a page from the Linux-PAM Manual and it's about the little helper functions that do the "hey, talk to the user for me" dance π«Ά
β¨ NAME β¨
pam_prompt, pam_vprompt β the interface to the conversation function. yes that's the whole vibe, we're the middleman between you and the conv function π
πΈ SYNOPSIS πΈ
#include <security/pam_ext.h>
int pam_prompt(pam_handle_t *pamh, int style, char **response,
const char *fmt, ...);
int pam_vprompt(pam_handle_t *pamh, int style, char **response,
const char *fmt, va_list args);
like, both of them, same energy, one's just the va_list twin π§
π¦ DESCRIPTION π¦
okay so pam_prompt is literally the sweetest little thing β it builds you a message out of the format string and the arguments you handed it (fmt and the ... bestie), and then it passes that message straight to the conversation function that the service already set up. main character handing off the mic π€
and here's the part where you gotta pay attention: on a successful return, response gets pointed at a string that came back out of the conversation function. that string is allocated on heap, so you π must π free π it. no cap. it's yours now, take care of it π
π RETURN VALUES π
PAM_BUF_ERRβ memory buffer error. the heap said no πPAM_CONV_ERRβ conversation failure. the chat did not go well, and not in a "left on read" way, more in a "something broke" way πPAM_SUCCESSβ conversation succeeded!! andresponseis set. slay β¨PAM_SYSTEM_ERRβ system error. classic π
π SEE ALSO π
pam(8), pam_conv(3) β go read these, iykyk π
β STANDARDS β
the pam_prompt and pam_vprompt functions are literally Linux-PAM extensions, so that's the whole standard situation, periodt π
and that's the page!! brought to you by Linux-PAM, dated 07/08/2026 β mwah, go free your strings, love u ππ
π¦ where this page comes from
- fedora 44: pam-devel 1.7.2-2.fc44 Β· BSD-3-Clause AND GPL-2.0-or-later
- fedora 44: pam-devel 1.7.2-2.fc44 Β· BSD-3-Clause AND GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms