Initiates a new PAM user authentication session.
PAM Library (libpam.a)
#include <security/pam_appl.h>
int pam_start (Service, User, Conversation, PAMHandle)
const char *Service;
const char *User;
const struct pam_conv *Conversation;
pam_handle_t **PAMHandle;
The pam_start subroutine begins a new PAM session for authentication within one of the four realms of the PAM environment [authentication, account, session, password]. This routine is called only at the start of the session, not at the start of each module comprising the session. The PAM handle, PAMHandle, returned by this subroutine is subsequently used by other PAM routines. The handle must be cleaned up at the end of use, which can easily be done by passing it as an argument to pam_end.
Item | Description |
---|---|
Service | The name of the service initiating this PAM session. |
User | The user who is being authenticated. |
Conversation | The PAM conversation struct enabling communication
with the user. This structure, pam_conv, consists of a pointer
to a conversation function, as well as a pointer to application data.
The argument conv is defined as:
The
conversation function, conv, allows PAM to send messages to,
and get input from, a user. The arguments to the function have the
following definition and behavior:
|
PAMHandle | The PAM handle representing the current user authentication session is returned upon successful completion. |
Upon successful completion, pam_start returns PAM_SUCCESS, and a reference to the pointer of a valid PAM handle is returned through PAMHandle. If the routine fails, a value different from PAM_SUCCESS is returned, and the PAMHandle reference is NULL.
Item | Description |
---|---|
PAM_SERVICE_ERR | An error occurred in a PAM module. |
PAM_SYSTEM_ERR | A system error occurred. |
PAM_BUF_ERR | A memory error occurred. |