'\" te
.\" Copyright 2016 Toomas Soome <tsoome@me.com>
.\" Copyright (C) 2002, 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_UNIX_SESSION 5 "Jan 3, 2016"
.SH NAME
pam_unix_session \- session management PAM module for UNIX
.SH SYNOPSIS
.LP
.nf
\fBpam_unix_session.so.1\fR
.fi

.SH DESCRIPTION
.sp
.LP
The \fBpam_unix_session\fR module implements \fBpam_sm_open_session\fR(3PAM)
and \fBpam_sm_close_session\fR(3PAM).
.sp
.LP
\fBpam_sm_open_session()\fR updates the \fB/var/adm/lastlog\fR file with the
information contained in the \fBPAM_USER\fR, \fBPAM_TTY\fR, and
\fBPAM_RHOSTS\fR items. \fBpam_unix_account\fR(5) uses this account to
determine the previous time the user logged in.
.sp
.LP
\fBpam_sm_close_session()\fR is a null function.
.sp
.LP
The following options can be passed to the module:
.sp
.ne 2
.na
\fBdebug\fR
.ad
.RS 9n
\fBsyslog\fR(3C) debugging information at the \fBLOG_DEBUG\fR level
.RE

.sp
.ne 2
.na
\fB\fBnowarn\fR\fR
.ad
.RS 9n
Turn off last login PAM_TEXT_INFO message.
.RE

.SH ERRORS
.sp
.LP
Upon successful completion, \fBPAM_SUCCESS\fR is returned. The following error
codes are returned upon error:
.sp
.ne 2
.na
\fB\fBPAM_SESSION_ERR\fR\fR
.ad
.RS 20n
Cannot make or remove the entry for the specified session (PAM_TTY is not
present).
.RE

.sp
.ne 2
.na
\fB\fBPAM_USER_UNKNOWN\fR\fR
.ad
.RS 20n
No account is present for \fIuser\fR.
.RE

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

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

.SH SEE ALSO
.sp
.LP
\fBpam\fR(3PAM), \fBpam_authenticate\fR(3PAM), \fBsyslog\fR(3C),
\fBlibpam\fR(3LIB), \fBpam.conf\fR(4), \fBnsswitch.conf\fR(4),
\fBattributes\fR(5), \fBpam_authtok_check\fR(5), \fBpam_authtok_get\fR(5),
\fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), \fBpam_passwd_auth\fR(5),
\fBpam_unix_account\fR(5),\fBpam_unix_auth\fR(5),
.SH NOTES
.sp
.LP
The interfaces in \fBlibpam\fR(3LIB) are MT-Safe only if each thread within the
multi-threaded application uses its own PAM handle.
.sp
.LP
The \fBpam_unix\fR(5) module is no longer supported. Similar functionality is
provided by \fBpam_authtok_check\fR(5), \fBpam_authtok_get\fR(5),
\fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), \fBpam_passwd_auth\fR(5),
\fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5), and
\fBpam_unix_session\fR(5).