1PAM_PUTENV(3)                  Linux-PAM Manual                  PAM_PUTENV(3)
2
3
4

NAME

6       pam_putenv - set or change PAM environment variable
7

SYNOPSIS

9       #include <security/pam_appl.h>
10
11       int pam_putenv(pam_handle_t *pamh, const char *name_value);
12

DESCRIPTION

14       The pam_putenv function is used to add or change the value of PAM
15       environment variables as associated with the pamh handle.
16
17       The pamh argument is an authentication handle obtained by a prior call
18       to pam_start(). The name_value argument is a single NUL terminated
19       string of one of the following forms:
20
21       NAME=value of variable
22           In this case the environment variable of the given NAME is set to
23           the indicated value: value of variable. If this variable is already
24           known, it is overwritten. Otherwise it is added to the PAM
25           environment.
26
27       NAME=
28           This function sets the variable to an empty value. It is listed
29           separately to indicate that this is the correct way to achieve such
30           a setting.
31
32       NAME
33           Without an '=' the pam_putenv() function will delete the
34           corresponding variable from the PAM environment.
35
36       pam_putenv() operates on a copy of name_value, which means in contrast
37       to putenv(3), the application is responsible to free the data.
38

RETURN VALUES

40       PAM_PERM_DENIED
41           Argument name_value given is a NULL pointer.
42
43       PAM_BAD_ITEM
44           Variable requested (for deletion) is not currently set.
45
46       PAM_ABORT
47           The pamh handle is corrupt.
48
49       PAM_BUF_ERR
50           Memory buffer error.
51
52       PAM_SUCCESS
53           The environment variable was successfully updated.
54

SEE ALSO

56       pam_start(3), pam_getenv(3), pam_getenvlist(3), pam_strerror(3), pam(8)
57
58
59
60Linux-PAM Manual                  05/18/2017                     PAM_PUTENV(3)
Impressum