2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PAM_PUTENV 3PAM "Mar 1, 2004"
8 pam_putenv \- change or add a value to the PAM environment
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lpam\fR [ \fIlibrary\fR ... ]
13 #include <security/pam_appl.h>
17 \fBint\fR \fBpam_putenv\fR(\fBpam_handle_t *\fR\fIpamh\fR, \fBconst char *\fR\fIname_value\fR);
23 The \fBpam_putenv()\fR function sets the value of the \fBPAM\fR environment
24 variable \fIname\fR equal to \fIvalue\fR either by altering an existing
25 \fBPAM\fR variable or by creating a new one.
28 The \fIname_value\fR argument points to a string of the form
29 \fIname\fR\fB=\fR\fIvalue\fR. A call to \fBpam_putenv()\fR does not immediately
30 change the environment. All \fIname_value\fR pairs are stored in the \fBPAM\fR
31 handle \fIpamh\fR. An application such as \fBlogin\fR(1) may make a call to
32 \fBpam_getenv\fR(3PAM) or \fBpam_getenvlist\fR(3PAM) to retrieve the \fBPAM\fR
33 environment variables saved in the \fBPAM\fR handle and set them in the
34 environment if appropriate. \fBlogin\fR will not set \fBPAM\fR environment
35 values which overwrite the values for \fBSHELL\fR, \fBHOME\fR, \fBLOGNAME\fR,
36 \fBMAIL\fR,\fB CDPATH\fR, \fBIFS\fR, and \fBPATH\fR. Nor will \fBlogin\fR set
37 \fBPAM\fR environment values which overwrite any value that begins with
41 If \fIname_value\fR equals \fBNAME=\fR, then the value associated with
42 \fBNAME\fR in the \fBPAM\fR handle will be set to an empty value. If
43 \fIname_value\fR equals \fBNAME\fR, then the environment variable \fBNAME\fR
44 will be removed from the \fBPAM\fR handle.
48 The \fBpam_putenv()\fR function may return one of the following values:
52 \fB\fBPAM_SUCCESS\fR\fR
55 The function returned successfully.
61 \fB\fBPAM_OPEN_ERR\fR\fR
64 \fBdlopen()\fR failed when dynamically loading a service module.
70 \fB\fBPAM_SYMBOL_ERR\fR\fR
79 \fB\fBPAM_SERVICE_ERR\fR\fR
82 Error in service module.
88 \fB\fBPAM_SYSTEM_ERR\fR\fR
97 \fB\fBPAM_BUF_ERR\fR\fR
106 \fB\fBPAM_CONV_ERR\fR\fR
109 Conversation failure.
115 \fB\fBPAM_PERM_DENIED\fR\fR
124 See \fBattributes\fR(5) for descriptions of the following attributes:
132 ATTRIBUTE TYPE ATTRIBUTE VALUE
134 Interface Stability Stable
136 MT-Level MT-Safe with exceptions
142 \fBdlopen\fR(3C), \fBpam\fR(3PAM), \fBpam_getenv\fR(3PAM),
143 \fBpam_getenvlist\fR(3PAM), \fBlibpam\fR(3LIB), \fBattributes\fR(5)
147 The interfaces in \fBlibpam\fR are MT-Safe only if each thread within the
148 multithreaded application uses its own \fBPAM\fR handle.