pam_open_session
()
function opens a new session for a user
previously authenticated with a call to
pam_authenticate
()
.
If successful, the function returns [PAM_SUCCESS].
The arguments for
pam_open_session
()
pamh
(in)
The PAM handle, which has been returned from a previous call to
pam_start
()
.
flags
(in)
Flags may be set to PAM_SILENT to disable messages from the session
service.
In many instances the
pam_open_session
()
pam_close_session
()
calls may be made by different processes. For example, in UNIX the
login
process opens a session, while the
init
process closes
the session.
In this case the, UTMP/WTMP entries may be used to link the call to
pam_close_session
()
with an earlier call to
pam_open_session
()
.
This is possible because UTMP/WTMP entries are uniquely identified by a
combination of attributes, including the user login name and device
name, which are accessible through the PAM handle,
pamh
.
The call to
pam_open_session
()
should precede UTMP/WTMP entry management and the call to
pam_close_session
()
should follow UTMP/WTMP exit management.