1 /* pam_password.c - PAM Password Management */
4 * $Id: pam_password.c,v 1.7 1997/04/05 06:56:45 morgan Exp $
5 * $FreeBSD: src/contrib/libpam/libpam/pam_password.c,v 1.1.1.1.6.2 2001/06/11 15:28:12 markm Exp $
7 * $Log: pam_password.c,v $
13 #include "pam_private.h"
15 int pam_chauthtok(pam_handle_t *pamh, int flags)
21 IF_NO_PAMH("pam_chauthtok", pamh, PAM_SYSTEM_ERR);
23 if (pamh->former.choice == PAM_NOT_STACKED) {
24 _pam_start_timer(pamh); /* we try to make the time for a failure
25 independent of the time it takes to
28 pamh->former.update = PAM_FALSE;
31 /* first loop through to check if there will be a problem */
32 if (pamh->former.update ||
33 (retval = _pam_dispatch(pamh, flags|PAM_PRELIM_CHECK,
34 PAM_CHAUTHTOK)) == PAM_SUCCESS) {
35 pamh->former.update = PAM_TRUE;
36 retval = _pam_dispatch(pamh, flags|PAM_UPDATE_AUTHTOK,
40 /* if we completed we should clean up */
41 if (retval != PAM_INCOMPLETE) {
43 pamh->former.update = PAM_FALSE;
44 _pam_await_timer(pamh, retval); /* if unsuccessful then wait now */
45 D(("pam_authenticate exit"));
47 D(("will resume when ready"));