File: teststr.c

package info (click to toggle)
cracklib2 2.8.19-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,084 kB
  • sloc: sh: 11,170; ansic: 2,626; xml: 365; python: 279; makefile: 185; sed: 16
file content (36 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * This program is copyright Alec Muffett 1993, portions copyright other authors.
 * The authors disclaim all responsibility or liability with respect to it's usage
 * or its effect upon hardware or computer systems.
 */

#define IN_CRACKLIB
#include "config.h"
#include "crack.h"
#include "packer.h"

int
main ()
{
    PWDICT *pwp;
    char buffer[STRINGSIZE];

    if (!(pwp = PWOpen (NULL, "r")))
    {
	perror ("PWOpen");
	return (-1);
    }

    printf("enter dictionary words, one per line...\n");

    while (fgets (buffer, STRINGSIZE, stdin))
    {
    	uint32_t i;

	Chop(buffer);
	i = FindPW(pwp, buffer);
	printf ("%s: %u%s\n", buffer, i, (i==PW_WORDS(pwp) ? " **** NOT FOUND ****" : ""));
    }

    return (0);
}