2 .\" Copyright (c) 1998, 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_OPEN_SESSION 3PAM "Oct 13, 1998"
8 pam_open_session, pam_close_session \- perform PAM session creation and
13 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lpam\fR [ \fIlibrary\fR ... ]
14 #include <security/pam_appl.h>
18 \fBint\fR \fBpam_open_session\fR(\fBpam_handle_t *\fR\fIpamh\fR, \fBint\fR \fIflags\fR);
23 \fBint\fR \fBpam_close_session\fR(\fBpam_handle_t *\fR\fIpamh\fR, \fBint\fR \fIflags\fR);
29 The \fBpam_open_session()\fR function is called after a user has been
30 successfully authenticated. See \fBpam_authenticate\fR(3PAM) and
31 \fBpam_acct_mgmt\fR(3PAM). It is used to notify the session modules that a new
32 session has been initiated. All programs that use the \fBpam\fR(3PAM)
33 library should invoke \fBpam_open_session()\fR when beginning a new session.
34 Upon termination of this activity, \fBpam_close_session()\fR should be invoked
35 to inform \fBpam\fR(3PAM) that the session has terminated.
38 The \fIpamh\fR argument is an authentication handle obtained by a prior call to
39 \fBpam_start()\fR. The following flag may be set in the \fIflags\fR field for
40 \fBpam_open_session()\fR and \fBpam_close_session()\fR:
44 \fB\fBPAM_SILENT\fR\fR
47 The session service should not generate any messages.
53 Upon successful completion, \fBPAM_SUCCESS\fR is returned. In addition to the
54 return values defined in \fBpam\fR(3PAM), the following value may be returned
59 \fB\fBPAM_SESSION_ERR\fR\fR
62 Cannot make or remove an entry for the specified session.
68 See \fBattributes\fR(5) for description of the following attributes:
76 ATTRIBUTE TYPE ATTRIBUTE VALUE
78 Interface Stability Stable
80 MT-Level MT-Safe with exceptions
86 \fBgetutxent\fR(3C), \fBpam\fR(3PAM), \fBpam_acct_mgmt\fR(3PAM),
87 \fBpam_authenticate\fR(3PAM), \fBpam_start\fR(3PAM), \fBattributes\fR(5)
91 In many instances, the \fBpam_open_session()\fR and \fBpam_close_session()\fR
92 calls may be made by different processes. For example, in UNIX the \fBlogin\fR
93 process opens a session, while the \fBinit\fR process closes the session. In
94 this case, \fBUTMP/WTMP\fR entries may be used to link the call to
95 \fBpam_close_session()\fR with an earlier call to \fBpam_open_session()\fR.
96 This is possible because \fBUTMP/WTMP\fR entries are uniquely identified by a
97 combination of attributes, including the user login name and device name, which
98 are accessible through the \fBPAM\fR handle, \fIpamh\fR. The call to
99 \fBpam_open_session()\fR should precede \fBUTMP/WTMP\fR entry management, and
100 the call to \fBpam_close_session()\fR should follow \fBUTMP/WTMP\fR exit
104 The interfaces in \fBlibpam\fR are MT-Safe only if each thread within the
105 multithreaded application uses its own \fBPAM\fR handle.