applied 040_pam-password-prompting.patch
[ckermit.git] / ckufio.c
index 298c48e..4648104 100644 (file)
--- a/ckufio.c
+++ b/ckufio.c
@@ -490,6 +490,9 @@ extern char * anonroot;
 static char guestpass[GUESTPASS] = { NUL, NUL }; /* Anonymous "password" */
 static int logged_in = 0;               /* Set when user is logged in */
 static int askpasswd = 0;               /* Have OK user, must ask for passwd */
+#ifdef CK_PAM
+extern int gotemptypasswd;
+#endif /* CK_PAM */
 #endif /* CK_LOGIN */
 
 #ifdef CKROOT
@@ -8043,8 +8046,12 @@ zvpass(p) char *p; {
             }
         }
         debug(F110,"zvpass","calling pam_authenticate",0);
-        if (*p)
-         pam_pw = p;
+        if (*p
+#ifdef CK_LOGIN
+           || gotemptypasswd
+#endif /* CK_LOGIN */
+           )
+           pam_pw = p;
         if ((pam_status = pam_authenticate(pamh, 0)) != PAM_SUCCESS) {
             reply = pam_strerror(pamh, pam_status);
             debug(F110,"zvpass PAM failure",reply,0);