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 $
6 * $DragonFly: src/contrib/libpam/libpam/Attic/pam_password.c,v 1.2 2003/06/17 04:24:03 dillon Exp $
8 * $Log: pam_password.c,v $
14 #include "pam_private.h"
16 int pam_chauthtok(pam_handle_t *pamh, int flags)
22 IF_NO_PAMH("pam_chauthtok", pamh, PAM_SYSTEM_ERR);
24 if (pamh->former.choice == PAM_NOT_STACKED) {
25 _pam_start_timer(pamh); /* we try to make the time for a failure
26 independent of the time it takes to
29 pamh->former.update = PAM_FALSE;
32 /* first loop through to check if there will be a problem */
33 if (pamh->former.update ||
34 (retval = _pam_dispatch(pamh, flags|PAM_PRELIM_CHECK,
35 PAM_CHAUTHTOK)) == PAM_SUCCESS) {
36 pamh->former.update = PAM_TRUE;
37 retval = _pam_dispatch(pamh, flags|PAM_UPDATE_AUTHTOK,
41 /* if we completed we should clean up */
42 if (retval != PAM_INCOMPLETE) {
44 pamh->former.update = PAM_FALSE;
45 _pam_await_timer(pamh, retval); /* if unsuccessful then wait now */
46 D(("pam_authenticate exit"));
48 D(("will resume when ready"));