diff --git a/src/password.c b/src/password.c index 85ab240..5ed4cf1 100644 --- a/src/password.c +++ b/src/password.c @@ -442,16 +442,22 @@ pam_sm_chauthtok(pam_handle_t *pamh, int flags, _pam_krb5_always_fail_prompter, &stash->v5result); stash->v5attempted = 1; - if ((i == PAM_SUCCESS) && - ((options->v4 == 1) || (options->v4_for_afs == 1))) { - v4_get_creds(ctx, pamh, stash, userinfo, - options, password, &i); - if (i != 0) { - if (options->debug) { - debug("error obtaining initial credentials using newly-set password: %d (%s)", - i, v5_error_message(i)); + if (i == PAM_SUCCESS) { + if ((options->v4 == 1) || (options->v4_for_afs == 1)) { + v4_get_creds(ctx, pamh, stash, userinfo, + options, password, &i); + if (i != 0) { + if (options->debug) { + debug("error obtaining initial credentials using newly-set password: %d (%s)", + i, v5_error_message(i)); + } } } + if (options->use_shmem) { + _pam_krb5_stash_shm_write(pamh, stash, + options, + userinfo); + } } }