table of contents
PAM_GET_AUTHTOK(3) | Linux-PAM Manual | PAM_GET_AUTHTOK(3) |
NAME¶
pam_get_authtok, pam_get_authtok_verify, pam_get_authtok_noverify - get authentication token
SYNOPSIS¶
#include <security/pam_ext.h>
int pam_get_authtok(pam_handle_t *pamh, int item, const char **authtok, const char *prompt);
int pam_get_authtok_noverify(pam_handle_t *pamh, const char **authtok, const char *prompt);
int pam_get_authtok_verify(pam_handle_t *pamh, const char **authtok, const char *prompt);
DESCRIPTION¶
The pam_get_authtok function returns the cached authentication token, or prompts the user if no token is currently cached. It is intended for internal use by Linux-PAM and PAM service modules. Upon successful return, authtok contains a pointer to the value of the authentication token. Note, this is a pointer to the actual data and should not be free()'ed or over-written!
The prompt argument specifies a prompt to use if no token is cached. If a NULL pointer is given, pam_get_authtok uses pre-defined prompts.
The following values are supported for item:
PAM_AUTHTOK
PAM_OLDAUTHTOK
The pam_get_authtok_noverify function can only be used for changing the password (from pam_sm_chauthtok(3)). It returns the cached authentication token, or prompts the user if no token is currently cached. The difference to pam_get_authtok is, that this function does not ask a second time for the password to verify it. Upon successful return, authtok contains a pointer to the value of the authentication token. Note, this is a pointer to the actual data and should not be free()'ed or over-written!
The pam_get_authtok_verify function can only be used to verify a password for mistypes gotten by pam_get_authtok_noverify(3). This function asks a second time for the password and verify it with the password provided by authtok argument. In case of an error, the value of authtok is undefined. Else this argument will point to the actual data and should not be free()'ed or over-written!
OPTIONS¶
pam_get_authtok honours the following module options:
try_first_pass
use_first_pass
use_authtok
authtok_type=XXX
RETURN VALUES¶
PAM_AUTH_ERR
PAM_AUTHTOK_ERR
PAM_SUCCESS
PAM_SYSTEM_ERR
PAM_TRY_AGAIN
SEE ALSO¶
STANDARDS¶
The pam_get_authtok function is a Linux-PAM extensions.
05/07/2023 | Linux-PAM |