Ends an existing PAM authentication session.
PAM Library (libpam.a)
#include <security/pam_appl.h>
int pam_end (PAMHandle, Status)
pam_handle_t *PAMHandle;
int Status;
The pam_end subroutine finishes and cleans up the authentication session represented by the PAM handle PAMHandle. Status denotes the current state of the PAMHandle and is passed through to a cleanup() function so that the memory used during that session can be properly unallocated. The cleanup() function can be set in the PAMHandle by PAM modules through the pam_set_data() routine. Upon completion of the subroutine, the PAM handle and associated memory is no longer valid.
Item | Description |
---|---|
PAMhandle | The PAM handle representing the current user authentication session. This handle is obtained by a call to pam_start(). |
Status | The state of the last PAM call. Some modules need to be cleaned according to error codes. |
Upon successful completion, pam_end returns PAM_SUCCESS. If the routine fails, a different error is returned, depending on the actual error.
Item | Description |
---|---|
PAM_SYSTEM_ERR | A system error occurred. |
PAM_BUF_ERR | A memory error occurred. |