pam_sm_open_session Subroutine

Purpose

PAM module-specific implementation of pam_open_session.

Library

PAM Library (libpam.a)

Syntax

#include <security/pam_appl.h>
#include <security/pam_modules.h>

int pam_sm_open_session (PAMHandle, Flags, Argc, Argv)
pam_handle_t *PAMHandle;
int Flags;
int Argc;
const char **Argv;

Description

When an application invokes pam_open_session(), the PAM Framework calls pam_sm_open_session for each module in the session module stack. The pam_sm_open_session module interface starts a new user session for an authenticated PAM user. All session-specific information and memory used by opening a session should be cleaned up by pam_sm_close_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 flags are used to set pam_acct_mgmt options. The recognized flag is:
  • PAM_SILENT
    • No messages should be displayed.
Argc The number of module options defined.
Argv The module options. These options are module-dependent. Any modules receiving invalid options should ignore them.

Return Values

Upon successful completion, pam_sm_open_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 or 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.