pam_putenv

Name

pam_putenv -- Add, replace or delete a PAM environment variable

Synopsis

#include <security/pam_appl.h>

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

Description

The pam_putenv() function shall modify the environment list associated with pamh. If name_value contains an '=' character, the characters to the left of the first '=' character represent the name, and the remaining characters after the '=' represent the value.

If the name environment variable exists in the environment associated with pamh, it shall be modified to have the value value. Otherwise, the name shall be added to the environment associated with pamh with the value value.

If there is no '=' character in name_value, the variable in the environment associated with pamh named name_value shall be deleted.

Return Value

On success, the pam_putenv() function shall return PAM_SUCCESS. Otherwise the return value indicates the error:

PAM_PERM_DENIED 

The name_value argument is a null pointer.

PAM_BAD_ITEM 

The PAM environment varable named name_value does not exist and therefore cannot be deleted.

PAM_ABORT 

The PAM handle identifed by pamh is corrupt.

PAM_BUF_ERR 

Memory buffer error.