PAM_SETENV(3)

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

hiii bestie πŸ’– welcome to the PAM_SETENV(3) page, aka the Library Functions Manual entry for the function that literally mirrors setenv(3). it’s giving β€œenvironment variable but make it PAM,” and we’re gonna get into it. ✨

πŸŽ€ NAME πŸŽ€

pam_setenv β€” literally mirrors setenv(3). 🫢

🌸 SYNOPSIS 🌸

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

int
pam_setenv(pam_handle_t *pamh, const char *name, const char *value,
    int overwrite);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so pam_setenv() sets an environment variable. its semantics are similar to those of setenv(3), but here’s the plot twist: it modifies the PAM context’s environment list instead of the application’s. πŸ’…

✨ RETURN VALUES ✨

the pam_setenv() function returns one of the following values:

  • [PAM_SUCCESS] β€” Success. πŸŽ‰
  • [PAM_BUF_ERR] β€” Memory buffer error. 😭
  • [PAM_SYSTEM_ERR] β€” System error. πŸ’€

🌈 SEE ALSO 🌈

the whole friend group: pam(3), pam_getenv(3), pam_getenvlist(3), pam_putenv(3), pam_strerror(3), setenv(3). iykyk. πŸ’œ

πŸ‘‘ STANDARDS πŸ‘‘

the pam_setenv() function is an OpenPAM extension. periodt. πŸ’…

🫢 AUTHORS 🫢

credit where credit is due, bestie: the pam_setenv() 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. 🫢

The OpenPAM library is maintained by Dag-Erling SmΓΈrgrav <des@des.no>. πŸ‘‘

mwah πŸ’‹ stay hydrated and may your buffers never overflow β€” this is the Debian build, dated June 27, 2023, for PAM_SETENV(3). πŸŽ€

πŸ“¦ where this page comes from