~registry/libpwquality/default

« back to all changes in this revision

Viewing changes to src/check.c

  • Committer: Tomas Mraz
  • Date: 2012-05-23 19:12:32 UTC
  • Revision ID: hg-v1:1b9f702fef8f54c09dfe9fd5a4c0584cc7a4c626
Call the simplicity checks before the cracklib check.

Show diffs side-by-side

added added

removed removed

Lines of Context:
555
555
 
556
556
        if ((buf = malloc(len)) == NULL)
557
557
                /* should get enough memory to obtain a nice score */
558
 
                return 0;
 
558
                return PWQ_ERROR_MEM_ALLOC;
559
559
 
560
560
        score = (len - pwq->min_length) * 2;
561
561
 
616
616
                return PWQ_ERROR_SAME_PASSWORD;
617
617
        }
618
618
 
 
619
        score = password_check(pwq, password, oldpassword, user, auxerror);
 
620
 
 
621
        if (score != 0)
 
622
                return score;
 
623
 
619
624
        msg = FascistCheck(password, pwq->dict_path);
620
625
        if (msg) {
621
626
                if (auxerror)
623
628
                return PWQ_ERROR_CRACKLIB_CHECK;
624
629
        }
625
630
 
626
 
        score = password_check(pwq, password, oldpassword, user, auxerror);
627
 
        if (score == 0) {
628
 
                score = password_score(pwq, password);
629
 
        }
 
631
        score = password_score(pwq, password);
630
632
 
631
633
        return score;
632
634
}