pam_putenv(3) — Linux manual page


PAM_PUTENV(3)                 Linux-PAM Manual                 PAM_PUTENV(3)

NAME         top

       pam_putenv - set or change PAM environment variable

SYNOPSIS         top

       #include <security/pam_appl.h>

       int pam_putenv(pam_handle_t *pamh, const char *name_value);

DESCRIPTION         top

       The pam_putenv function is used to add or change the value of PAM
       environment variables as associated with the pamh handle.

       The pamh argument is an authentication handle obtained by a prior
       call to pam_start(). The name_value argument is a single NUL
       terminated string of one of the following forms:

       NAME=value of variable
           In this case the environment variable of the given NAME is set to
           the indicated value: value of variable. If this variable is
           already known, it is overwritten. Otherwise it is added to the
           PAM environment.

           This function sets the variable to an empty value. It is listed
           separately to indicate that this is the correct way to achieve
           such a setting.

           Without an '=' the pam_putenv() function will delete the
           corresponding variable from the PAM environment.

       pam_putenv() operates on a copy of name_value, which means in
       contrast to putenv(3), the application is responsible to free the

RETURN VALUES         top

           Argument name_value given is a NULL pointer.

           Variable requested (for deletion) is not currently set.

           The pamh handle is corrupt.

           Memory buffer error.

           The environment variable was successfully updated.

SEE ALSO         top

       pam_start(3), pam_getenv(3), pam_getenvlist(3), pam_strerror(3),

COLOPHON         top

       This page is part of the linux-pam (Pluggable Authentication Modules
       for Linux) project.  Information about the project can be found at 
       ⟨⟩.  If you have a bug report for this manual
       page, see ⟨//⟩.  This page was obtained from the
       tarball Linux-PAM-1.3.0.tar.bz2 fetched from
       ⟨⟩ on 2020-07-14.  If you discover
       any rendering problems in this HTML version of the page, or you
       believe there is a better or more up-to-date source for the page, or
       you have corrections or improvements to the information in this
       COLOPHON (which is not part of the original manual page), send a mail

Linux-PAM Manual                 04/01/2016                    PAM_PUTENV(3)

Pages that refer to this page: pam(3)pam_getenv(3)pam_getenvlist(3)pam_misc_paste_env(3)pam_misc_setenv(3)