summaryrefslogtreecommitdiff
path: root/debian/patches/regular_crypt
blob: 9895e33efac6f5bc351a3fbaba7783ce9be99738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Use libc's crypt in the regular way
 * That should support newer crypt types.
 * We do the check before the weird stuff but keep it to not break setups
   using broken md5 hashing or bigcrypt.
 * CRYPTED_BCPWD_LEN as an upper limit seems to be ok by now.
Author: Timo Weingärtner <timo@tiwe.de>
Forwarded: no
Last-Update: 2012-06-20

--- libpam-pwdfile-0.99.orig/pam_pwdfile.c
+++ libpam-pwdfile-0.99/pam_pwdfile.c
@@ -348,6 +348,10 @@ PAM_EXTERN int pam_sm_authenticate(pam_h
     
     temp_result = 0;
     
+    if (strcmp(crypt(password, stored_crypted_password), stored_crypted_password) == 0) {
+	D(_pam_log(LOG_ERR,"password matched using the systems crypt()"));
+	temp_result = 1;
+    }
     /* Extract the salt and set the passwd length, depending on MD5 or DES */
     if (strncmp(stored_crypted_password, "$1$", 3) == 0) {
 	D(_pam_log(LOG_ERR,"password hash type is 'md5'"));