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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
'\" te
.\" Copyright (c) 1998, 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_SM_SETCRED 3PAM "Nov 18, 2003"
.SH NAME
pam_sm_setcred \- service provider implementation for pam_setcred
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lpam\fR [ \fIlibrary\fR ... ]
#include <security/pam_appl.h>
#include <security/pam_modules.h>
\fBint\fR \fBpam_sm_setcred\fR(\fBpam_handle_t *\fR\fIpamh\fR, \fBint\fR \fIflags\fR, \fBint\fR \fIargc\fR,
\fBconst char **\fR\fIargv\fR);
.fi
.SH DESCRIPTION
.sp
.LP
In response to a call to \fBpam_setcred\fR(3PAM), the \fBPAM\fR framework
calls \fBpam_sm_setcred()\fR from the modules listed in the \fBpam.conf\fR(5)
file. The authentication provider supplies the back-end functionality for this
interface function.
.sp
.LP
The \fBpam_sm_setcred()\fR function is called to set the credentials of the
current user associated with the authentication handle, \fIpamh\fR. The
following flags may be set in the \fIflags\fR field. Note that the first four
flags are mutually exclusive:
.sp
.ne 2
.na
\fB\fBPAM_ESTABLISH_CRED\fR\fR
.ad
.RS 25n
Set user credentials for the authentication service.
.RE
.sp
.ne 2
.na
\fB\fBPAM_DELETE_CRED\fR\fR
.ad
.RS 25n
Delete user credentials associated with the authentication service.
.RE
.sp
.ne 2
.na
\fB\fBPAM_REINITIALIZE_CRED\fR\fR
.ad
.RS 25n
Reinitialize user credentials.
.RE
.sp
.ne 2
.na
\fB\fBPAM_REFRESH_CRED\fR\fR
.ad
.RS 25n
Extend lifetime of user credentials.
.RE
.sp
.ne 2
.na
\fB\fBPAM_SILENT\fR\fR
.ad
.RS 25n
Authentication service should not generate messages
.RE
.sp
.LP
If no flag is set, \fBPAM_ESTABLISH\fR \fB_CRED\fR is used as the default.
.sp
.LP
The \fIargc\fR argument represents the number of module options passed in from
the configuration file \fBpam.conf\fR(5). \fIargv\fR specifies the module
options, which are interpreted and processed by the authentication service. If
an unknown option is passed to the module, an error should be logged and the
option ignored.
.sp
.LP
If the \fBPAM_SILENT\fR flag is not set, then \fBpam_sm_setcred()\fR should
print any failure status from the corresponding \fBpam_sm_authenticate()\fR
function using the conversation function.
.sp
.LP
The authentication status (success or reason for failure) is saved as
module-specific state in the authentication handle by the authentication
module. The status should be retrieved using \fBpam_get_data()\fR, and used to
determine if user credentials should be set.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fBPAM_SUCCESS\fR should be returned. The
following values may also be returned upon error:
.sp
.ne 2
.na
\fB\fBPAM_CRED_UNAVAIL\fR\fR
.ad
.RS 20n
Underlying authentication service can not retrieve user credentials.
.RE
.sp
.ne 2
.na
\fB\fBPAM_CRED_EXPIRED\fR\fR
.ad
.RS 20n
User credentials have expired.
.RE
.sp
.ne 2
.na
\fB\fBPAM_USER_UNKNOWN\fR\fR
.ad
.RS 20n
User unknown to the authentication service.
.RE
.sp
.ne 2
.na
\fB\fBPAM_CRED_ERR\fR\fR
.ad
.RS 20n
Failure in setting user credentials.
.RE
.sp
.ne 2
.na
\fB\fBPAM_IGNORE\fR\fR
.ad
.RS 20n
Ignore underlying authentication module regardless of whether the control flag
is \fIrequired\fR,\fIoptional\fR, or \fIsufficient\fR.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for description 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 pam (3PAM),
.BR pam_authenticate (3PAM),
.BR pam_get_data (3PAM)
.BR libpam (3LIB),
.BR pam_setcred (3PAM),
.BR pam_sm_authenticate (3PAM),
.BR pam.conf (5),
.BR attributes (7)
.SH NOTES
.sp
.LP
The \fBpam_sm_setcred()\fR function is passed the same module options that are
used by \fBpam_sm_authenticate()\fR.
.sp
.LP
The interfaces in \fBlibpam\fR are MT-Safe only if each thread within the
multithreaded application uses its own \fBPAM\fR handle.
.sp
.LP
If the \fBPAM_REPOSITORY\fR \fIitem_type\fR is set and a service module does
not recognize the type, the service module does not process any information,
and returns \fBPAM_IGNORE\fR. If the \fBPAM_REPOSITORY\fR \fIitem_type\fR is
not set, a service module performs its default action.
|