Make maxclassrepeat=1 behavior consistent with docs (#9)
authorSaul Johnson <saul.a.johnson@gmail.com>
Fri, 10 Mar 2017 13:03:03 +0000 (13:03 +0000)
committerTomáš Mráz <t8m@users.noreply.github.com>
Fri, 10 Mar 2017 13:03:03 +0000 (14:03 +0100)
* modules/pam_cracklib/pam_cracklib.c (simple): Apply the maxclassrepeat when greater than 0.

modules/pam_cracklib/pam_cracklib.c

index 165493194e3e7e0e131699aeb4adb5a31ee75ed6..cbfa1288bbe674703699a72796f3ce10693daa92 100644 (file)
@@ -408,7 +408,7 @@ static int simple(struct cracklib_options *opt, const char *new)
             } else
                 sameclass++;
         }
-        if (opt->max_class_repeat > 1 && sameclass > opt->max_class_repeat) {
+        if (opt->max_class_repeat > 0 && sameclass > opt->max_class_repeat) {
                 return 1;
         }
     }