Previous section.

X/Open Single Sign-on Service (XSSO) -<br> Pluggable Authentication Modules

X/Open Single Sign-on Service (XSSO) -
Pluggable Authentication Modules
Copyright © 1997 The Open Group


pam_close_session - close an existing user session


#include <security/pam_appl.h>

int pam_close_session ( pam_handle_t *pamh, int flags );


The pam_close_session() function informs the PAM framework that the user session previously opened by a call to pam_open_session has terminated.

In many instances the pam_open_session() and 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.

The arguments for pam_close_session() are:

pamh (in)

The PAM authentication 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.


The following PAM status codes shall be returned:


Successful completion.


There has been a failure in creating or removing and entry for the specified session.


Failure when dynamically loading a service module.


Symbol not found in service module.


Error in service module.


System error.


Memory buffer error.


Conversation error.


Permission denied.

[??] Some characters or strings that appear in the printed document are not easily representable using HTML.

Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index