1 --- Linux-PAM-0.99.3.0/modules/pam_cracklib/pam_cracklib.c.try-first-pass 2006-01-08 10:49:05.000000000 +0100
2 +++ Linux-PAM-0.99.3.0/modules/pam_cracklib/pam_cracklib.c 2006-02-24 10:42:53.000000000 +0100
8 char prompt_type[BUFSIZ];
9 char cracklib_dictpath[PATH_MAX];
13 } else if (!strncmp(*argv,"use_authtok",11)) {
15 + } else if (!strncmp(*argv,"use_first_pass",14)) {
16 + opt->use_authtok = 1;
17 + } else if (!strncmp(*argv,"try_first_pass",14)) {
18 + opt->try_first_pass = 1;
19 } else if (!strncmp(*argv,"dictpath=",9)) {
20 strncpy(opt->cracklib_dictpath, *argv+9,
21 sizeof(opt->cracklib_dictpath) - 1);
23 * set PAM_AUTHTOK and return
26 - if (options.use_authtok == 1) {
27 + if (options.use_authtok == 1 || options.try_first_pass == 1) {
28 const void *item = NULL;
30 retval = pam_get_item(pamh, PAM_AUTHTOK, &item);
32 } else if (item != NULL) { /* we have a password! */
33 token1 = x_strdup(item);
35 + options.use_authtok = 1; /* don't ask for the password again */
37 retval = PAM_AUTHTOK_RECOVERY_ERR; /* didn't work */
43 + if (options.use_authtok != 1) {
44 /* Prepare to ask the user for the first time */
46 retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &resp,