pam_close_session Subroutine

Purpose

Ends a currently open PAM user session.

Library

PAM Library (libpam.a)

Syntax

#include <security/pam_appl.h>

int pam_close_session (PAMHandle, Flags)
pam_handle_t *PAMHandle;
int Flags;

Description

The pam_close_session subroutine ends a PAM user session started by pam_open_session().

Parameters

Item Description
PAMhandle The PAM handle representing the current user authentication session. This handle is obtained by a call to pam_start().
Flags The following flag may be set:
  • PAM_SILENT
    • No messages should be displayed

Return Values

Upon successful completion, pam_close_session returns PAM_SUCCESS. If the routine fails, a different error is returned, depending on the actual error.

Error Codes

Item Description
PAM_SESSION_ERR An error occurred while creating/removing an entry for the new session.
PAM_USER_UNKNOWN The user is not known.
PAM_OPEN_ERR One of the PAM authentication modules could not be loaded.
PAM_SYMBOL_ERR A necessary item is not available to a PAM module.
PAM_SERVICE_ERR An error occurred in a PAM module.
PAM_SYSTEM_ERR A system error occurred.
PAM_BUF_ERR A memory error occurred.
PAM_CONV_ERR A conversation error occurred.
PAM_PERM_DENIED Access permission was denied to the user.