2a06ea
diff -up cracklib-2.9.0/lib/fascist.c.simplistic cracklib-2.9.0/lib/fascist.c
2a06ea
--- cracklib-2.9.0/lib/fascist.c.simplistic	2013-10-31 14:46:23.160959124 +0100
2a06ea
+++ cracklib-2.9.0/lib/fascist.c	2013-10-31 14:46:23.164959212 +0100
2a06ea
@@ -55,7 +55,6 @@ static char *r_destructors[] = {
2a06ea
 
2a06ea
     "/?p@?p",                   /* purging out punctuation/symbols/junk */
2a06ea
     "/?s@?s",
2a06ea
-    "/?X@?X",
2a06ea
 
2a06ea
     /* attempt reverse engineering of password strings */
2a06ea
 
2a06ea
@@ -454,6 +453,12 @@ GTry(rawtext, password)
2a06ea
 	    continue;
2a06ea
 	}
2a06ea
 
2a06ea
+	if (len - strlen(mp) >= 3)
2a06ea
+	{
2a06ea
+	    /* purged too much */
2a06ea
+	    continue;
2a06ea
+	}
2a06ea
+
2a06ea
 #ifdef DEBUG
2a06ea
 	printf("%-16s = %-16s (destruct %s)\n", mp, rawtext, r_destructors[i]);
2a06ea
 #endif
2a06ea
@@ -480,6 +485,12 @@ GTry(rawtext, password)
2a06ea
 	    continue;
2a06ea
 	}
2a06ea
 
2a06ea
+	if (len - strlen(mp) >= 3)
2a06ea
+	{
2a06ea
+	    /* purged too much */
2a06ea
+	    continue;
2a06ea
+	}
2a06ea
+
2a06ea
 #ifdef DEBUG
2a06ea
 	printf("%-16s = %-16s (construct %s)\n", mp, password, r_constructors[i]);
2a06ea
 #endif
2a06ea
@@ -699,6 +710,7 @@ FascistLookUser(PWDICT *pwp, char *instr
2a06ea
     char rpassword[STRINGSIZE];
2a06ea
     char area[STRINGSIZE];
2a06ea
     uint32_t notfound;
2a06ea
+    int len;
2a06ea
 
2a06ea
     notfound = PW_WORDS(pwp);
2a06ea
     /* already truncated if from FascistCheck() */
2a06ea
@@ -748,6 +760,7 @@ FascistLookUser(PWDICT *pwp, char *instr
2a06ea
 	return _("it is all whitespace");
2a06ea
     }
2a06ea
 
2a06ea
+    len = strlen(password);
2a06ea
     i = 0;
2a06ea
     ptr = password;
2a06ea
     while (ptr[0] && ptr[1])
2a06ea
@@ -759,10 +772,9 @@ FascistLookUser(PWDICT *pwp, char *instr
2a06ea
 	ptr++;
2a06ea
     }
2a06ea
 
2a06ea
-    /*  Change by Ben Karsin from ITS at University of Hawaii at Manoa.  Static MAXSTEP 
2a06ea
-        would generate many false positives for long passwords. */
2a06ea
-    maxrepeat = 3+(0.09*strlen(password));
2a06ea
-    if (i > maxrepeat)
2a06ea
+    /*  We were still generating false positives for long passwords.
2a06ea
+        Just count systematic double as a single character. */
2a06ea
+    if (len - i < MINLEN)
2a06ea
     {
2a06ea
 	return _("it is too simplistic/systematic");
2a06ea
     }
2a06ea
@@ -795,6 +807,12 @@ FascistLookUser(PWDICT *pwp, char *instr
2a06ea
 	    continue;
2a06ea
 	}
2a06ea
 
2a06ea
+	if (len - strlen(a) >= 3)
2a06ea
+	{
2a06ea
+	    /* purged too much */
2a06ea
+	    continue;
2a06ea
+	}
2a06ea
+
2a06ea
 #ifdef DEBUG
2a06ea
 	printf("%-16s (dict)\n", a);
2a06ea
 #endif
2a06ea
@@ -815,6 +833,13 @@ FascistLookUser(PWDICT *pwp, char *instr
2a06ea
 	{
2a06ea
 	    continue;
2a06ea
 	}
2a06ea
+
2a06ea
+	if (len - strlen(a) >= 3)
2a06ea
+	{
2a06ea
+	    /* purged too much */
2a06ea
+	    continue;
2a06ea
+	}
2a06ea
+
2a06ea
 #ifdef DEBUG
2a06ea
 	printf("%-16s (reversed dict)\n", a);
2a06ea
 #endif
2a06ea
diff -up cracklib-2.9.0/util/cracklib-format.simplistic cracklib-2.9.0/util/cracklib-format
2a06ea
--- cracklib-2.9.0/util/cracklib-format.simplistic	2013-06-01 16:47:13.000000000 +0200
2a06ea
+++ cracklib-2.9.0/util/cracklib-format	2013-10-31 15:24:01.976736045 +0100
2a06ea
@@ -3,8 +3,10 @@
2a06ea
 # This preprocesses a set of word lists into a suitable form for input
2a06ea
 # into cracklib-packer
2a06ea
 #
2a06ea
+LC_ALL=C
2a06ea
+export LC_ALL
2a06ea
 gzip -cdf "$@" |
2a06ea
     grep -v '^\(#\|$\)' |
2a06ea
-    tr '[A-Z]' '[a-z]' |
2a06ea
-    tr -cd '\012[a-z][0-9]' |
2a06ea
+    tr '[:upper:]' '[:lower:]' |
2a06ea
+    tr -cd '\n[:graph:]' |
2a06ea
     sort -u