# pam_putenv(3) - phpMan

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



**NAME**
       pam_putenv - set or change PAM environment variable

**SYNOPSIS**
       **#include** **<security/pam**___**appl.h>**

       **int** **pam**___**putenv(pam**___**handle**___**t** *****_pamh_**,** **const** **char** *****_name_value_**);**

**DESCRIPTION**
       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.

       NAME=
           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.

       NAME
           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 for freeing the data.

**RETURN** **VALUES**
       PAM_PERM_DENIED
           Argument _name_value_ given is a NULL pointer.

       PAM_BAD_ITEM
           Variable requested (for deletion) is not currently set.

       PAM_ABORT
           The _pamh_ handle is corrupt.

       PAM_BUF_ERR
           Memory buffer error.

       PAM_SUCCESS
           The environment variable was successfully updated.

**SEE** **ALSO**
       **pam**___**[start**(3)], **pam**___**[getenv**(3)], **pam**___**[getenvlist**(3)], **pam**___**[strerror**(3)], [**pam**(7)]



Linux-PAM Manual                  06/08/2020                     [PAM_PUTENV(3)]
