pam_chauthtok - perform password related functions within the PAM framework
int pam_chauthtok ( pam_handle_t *pamh, int flags );
pam_chauthtok()function changes the authentication token associated with a particular user referenced by the authentication handle, pamh.
pam_chauthtok()performs a preliminary check before attempting to update passwords. This check is performed for each password module in the stack as listed in PAM configuration data. The check may include pinging remote name services to determine if they are available. If pam_chauthtok()returns [PAM_TRY_AGAIN], then the check has failed, and passwords are not updated.
The underlying PAM password modules may use the PAM conversation functions to get relevant information from the user.
- That it is possible that the password update succeeds only in some modules.
For security reasons,
pam_chauthtok()clears the PAM_AUTHTOK and PAM_OLDAUTHTOK items in the PAM handle prior to returning to the calling application.
The arguments for
- pamh (in)
The PAM authentication handle, returned from a previous call to
- flags (in)
Flags may be set to:
Disable messages from the password service.
Specify that only expired passwords should be changed. If this flag is not passed, all password services should update their passwords.
The flag PAM_CHANGE_EXPIRED_AUTHTOK is typically used by a login application which has determined that the user's password has aged or expired. Before allowing the user to login, the login application may invoke
pam_chauthtok()with this flag to allow the user to update the password. Typically applications such as passwd should not use this flag.
The following PAM status codes shall be returned:
There has been a failure in updating the authentication token.
Preliminary check on the password has failed. Try again.
The authentication information cannot be recovered.
The authentication token lock is busy.
Authentication token aging is disabled.
The user is unknown to the password service.
The caller does not possess the required authority.
Failure when dynamically loading a service module.
Symbol not found in service module.
Error in service module.
Memory buffer error.
[??] Some characters or strings that appear in the printed document are not easily representable using HTML.