pam_getenv Subroutine

Purpose

Returns the value of a defined PAM environment variable.

Library

PAM Library (libpam.a)

Syntax

#include <security/pam_appl.h>

char *pam_getenv (PAMHandle, VarName)
pam_handle_t *PAMHandle;
char *VarName;

Description

The pam_getenv subroutine retrieves the value of the PAM environment variable VarName stored in the PAM handle PAMHandle. Environment variables can be defined through the pam_putenv() call. If VarName is defined, its value is returned in memory allocated by the library; it is the caller's responsibility to free this memory. Otherwise, a NULL pointer is returned.

Parameters

Item Description
PAMHandle The PAM handle representing the current user authentication session. This handle is obtained by a call to pam_start().
VarName The name of the PAM environment variable to get the value for.

Return Values

Upon successful completion, pam_getenv returns the value of the VarName PAM environment variable. If the routine fails or VarName is not defined, NULL is returned.