PAM_GET_DATA(3)
π PAM_GET_DATA π
okay so real quick β this page is PAM_GET_DATA(3), and it lives in the Linux-PAM Manual, which is the whole vibe here. let's get into it bestie π«Ά
β¨ NAME β¨
pam_get_data β get module internal data
like, it grabs the internal data your module stashed away. that's the whole thing. π
πΈ SYNOPSIS πΈ
#include <security/pam_modules.h>
int pam_get_data(const pam_handle_t *pamh, const char *module_data_name,
const void **data);
π¦ DESCRIPTION π¦
so this function and pam_set_data(3) are literally a duo β think main character energy, but for managing module-specific data that's only meaningful to the PAM module that's calling. nobody else cares about it, and that's the point. π
pam_get_data goes looking for the object associated with the (hopefully) unique string module_data_name, inside the PAM context that the pamh argument points to.
if the call to pam_get_data succeeds, you get data pointing at that object. but β and this is the important part ngl β that data is not a copy. so your module should treat it as constant. don't be out here editing it, okay? π
β RETURN VALUES β
PAM_SUCCESSβ slay, the data was successful retrieved. β¨PAM_SYSTEM_ERRβ you handed over aNULLpointer as the PAM handle, or an application tried to call this function. not it. πPAM_NO_MODULE_DATAβ there's no module specific data present. empty. nothing. nada. π
π SEE ALSO π
pam_end(3), pam_set_data(3), pam_strerror(3)
go read those too, they're iconic, iykyk π
lowkey reminder: data points at the real object, not a copy β treat it as constant, bestie. no cap. π₯
that's the whole page! brought to you by Linux-PAM, dated 07/08/2026, filed under PAM_GET_DATA(3) β mwah, go forth and manage your module data responsibly π
β¨π
π¦ 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