2 * This program is copyright Alec Muffett 1993. The author disclaims all
3 * responsibility or liability with respect to it's usage or its effect
4 * upon hardware or computer systems, and maintains copyright as set out
5 * in the "LICENCE" document which accompanies distributions of Crack v4.0
10 * Modified as part of the krb5-strength project as follows:
12 * 2009-10-14 Russ Allbery <eagle@eyrie.org>
13 * - Add ANSI C protototypes for all functions.
14 * 2010-03-14 Russ Allbery <eagle@eyrie.org>
15 * - Use unsigned long instead of int32 to avoid printf warnings.
16 * 2016-11-06 Mark Sirota <msirota@isc.upenn.edu>
17 * - Display a warning when processing out-of-order input.
23 main(int argc, char *argv[])
28 char buffer[STRINGSIZE], prev[STRINGSIZE];
32 fprintf(stderr, "Usage:\t%s dbname\n", argv[0]);
36 if (!(pwp = PWOpen(argv[1], "w")))
45 for (readed = 0; fgets(buffer, STRINGSIZE, stdin); /* nothing */)
49 buffer[MAXWORDLEN - 1] = '\0';
55 fprintf(stderr, "skipping line: %lu\n", readed);
60 * If this happens, strcmp() in FindPW() in packlib.c will be unhappy.
62 if (strcmp(buffer, prev) < 0)
64 fprintf(stderr, "warning: input out of order: '%s' should not"
65 " follow '%s' (line %lu), skipping\n", buffer, prev,
71 if (PutPW(pwp, buffer))
73 fprintf(stderr, "error: PutPW '%s' line %luy\n", buffer, readed);
81 printf("%lu %lu\n", readed, wrote);