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!! and response is 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