summaryrefslogtreecommitdiff
path: root/usr/src/man/man3pam/pam_putenv.3pam
blob: 2006e8c877d689af57b78a454a34fcece568e45c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
'\" te
.\"  Copyright (c) 2004, Sun Microsystems, Inc.   All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH PAM_PUTENV 3PAM "Mar 1, 2004"
.SH NAME
pam_putenv \- change or add a value to the PAM environment
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lpam\fR [ \fIlibrary\fR ... ]
#include <security/pam_appl.h>



\fBint\fR \fBpam_putenv\fR(\fBpam_handle_t *\fR\fIpamh\fR, \fBconst char *\fR\fIname_value\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The  \fBpam_putenv()\fR function sets the value of the \fBPAM\fR environment
variable \fIname\fR equal to \fIvalue\fR either by altering an existing
\fBPAM\fR variable or by creating a new one.
.sp
.LP
The \fIname_value\fR argument points to a string of the form
\fIname\fR\fB=\fR\fIvalue\fR. A call to \fBpam_putenv()\fR does not immediately
change the environment. All \fIname_value\fR pairs are stored in the \fBPAM\fR
handle \fIpamh\fR. An application such as  \fBlogin\fR(1) may make a call to
\fBpam_getenv\fR(3PAM) or \fBpam_getenvlist\fR(3PAM) to retrieve the \fBPAM\fR
environment variables saved in the \fBPAM\fR handle and set them in the
environment if appropriate. \fBlogin\fR will not set \fBPAM\fR environment
values which overwrite the values for  \fBSHELL\fR, \fBHOME\fR, \fBLOGNAME\fR,
\fBMAIL\fR,\fB CDPATH\fR, \fBIFS\fR, and  \fBPATH\fR. Nor will \fBlogin\fR set
\fBPAM\fR environment values which overwrite any value that begins with
\fBLD_\fR.
.sp
.LP
If \fIname_value\fR equals  \fBNAME=\fR, then the value associated with
\fBNAME\fR in the \fBPAM\fR handle will be set to an empty value.  If
\fIname_value\fR equals  \fBNAME\fR, then the environment variable  \fBNAME\fR
will be removed from the \fBPAM\fR handle.
.SH RETURN VALUES
.sp
.LP
The \fBpam_putenv()\fR function may return one of the following values:
.sp
.ne 2
.na
\fB\fBPAM_SUCCESS\fR\fR
.ad
.RS 19n
The function returned successfully.
.RE

.sp
.ne 2
.na
\fB\fBPAM_OPEN_ERR\fR\fR
.ad
.RS 19n
\fBdlopen()\fR failed when dynamically loading a service module.
.RE

.sp
.ne 2
.na
\fB\fBPAM_SYMBOL_ERR\fR\fR
.ad
.RS 19n
Symbol not found.
.RE

.sp
.ne 2
.na
\fB\fBPAM_SERVICE_ERR\fR\fR
.ad
.RS 19n
Error in service module.
.RE

.sp
.ne 2
.na
\fB\fBPAM_SYSTEM_ERR\fR\fR
.ad
.RS 19n
System error.
.RE

.sp
.ne 2
.na
\fB\fBPAM_BUF_ERR\fR\fR
.ad
.RS 19n
Memory buffer error.
.RE

.sp
.ne 2
.na
\fB\fBPAM_CONV_ERR\fR\fR
.ad
.RS 19n
Conversation failure.
.RE

.sp
.ne 2
.na
\fB\fBPAM_PERM_DENIED\fR\fR
.ad
.RS 19n
Permission denied.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	 Stable
_
MT-Level	MT-Safe with exceptions
.TE

.SH SEE ALSO
.sp
.LP
.BR dlopen (3C),
.BR libpam (3LIB),
.BR pam (3PAM),
.BR pam_getenv (3PAM),
.BR pam_getenvlist (3PAM),
.BR attributes (7)
.SH NOTES
.sp
.LP
The interfaces in  \fBlibpam\fR are MT-Safe only if each thread within the
multithreaded application uses its own \fBPAM\fR handle.