From: Nathan Neulinger Date: Fri, 4 Feb 2005 17:04:19 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v2.7-3.0pre1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de12cb74901dbe20229f3efcbcba2712c0042547;p=cracklib *** empty log message *** git-svn-id: file:///tmp/cracklib-svn/trunk@10 4175fe1e-86d5-4fdc-8e6a-506fab9d8533 --- diff --git a/cracklib/util/.cvsignore b/cracklib/util/.cvsignore index 97c5746..fed7750 100644 --- a/cracklib/util/.cvsignore +++ b/cracklib/util/.cvsignore @@ -7,7 +7,7 @@ testlib testcheck packer cracklib-packer -create-cracklib-dict +cracklib-check Makefile .libs .deps diff --git a/cracklib/util/Makefile.am b/cracklib/util/Makefile.am index 8891de7..8343930 100644 --- a/cracklib/util/Makefile.am +++ b/cracklib/util/Makefile.am @@ -5,16 +5,17 @@ noinst_PROGRAMS = cracklib-packer testlib testnum teststr unpacker sbin_SCRIPTS = create-cracklib-dict cracklib-format LDADD = ../lib/libcrack.la -AM_CPPFLAGS = -I. -I.. -I$(top_srcdir)/lib -cracklib-check_SOURCES = cracklib-check.c -cracklib-check_LDADD = $(LDADD) +AM_CPPFLAGS = -I. -I.. -I$(top_srcdir)/lib '-DDEFAULT_CRACKLIB_DICT="$(pkgdatadir)/pw_dict"' -cracklib-packer_SOURCES = packer.c -cracklib-packer_LDADD = $(LDADD) +cracklib_check_SOURCES = check.c +cracklib_check_LDADD = $(LDADD) -cracklib-unpacker_SOURCES = unpacker.c -cracklib-unpacker_LDADD = $(LDADD) +cracklib_packer_SOURCES = packer.c +cracklib_packer_LDADD = $(LDADD) + +cracklib_unpacker_SOURCES = unpacker.c +cracklib_unpacker_LDADD = $(LDADD) testlib_SOURCES = testlib.c testlib_LDADD = $(LDADD) diff --git a/cracklib/util/testcheck.c b/cracklib/util/check.c similarity index 100% rename from cracklib/util/testcheck.c rename to cracklib/util/check.c diff --git a/cracklib/util/create-cracklib-dict b/cracklib/util/create-cracklib-dict new file mode 100755 index 0000000..e491014 --- /dev/null +++ b/cracklib/util/create-cracklib-dict @@ -0,0 +1,19 @@ +#!/bin/sh +if [ -z "$*" ]; then + echo "Usage:" + echo " create-cracklib-dict wordlist ..." + echo + echo "This script takes one or more word list files as arguments" + echo "and converts them into cracklib dictionaries for use" + echo "by password checking programs. The results are placed in" + echo "the default compiled-in dictionary location." + echo + echo "If you wish to store the dictionary in a different location," + echo "use the cracklib-format and cracklib-packer commands directly." + echo + echo "Example:" + echo "create-cracklib-dict /usr/share/words" +else + cracklib-format $* | cracklib-packer +fi + diff --git a/cracklib/util/mkdict b/cracklib/util/mkdict deleted file mode 100755 index 54c70ff..0000000 --- a/cracklib/util/mkdict +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -### -# This program is copyright Alec Muffett 1993. The author disclaims all -# responsibility or liability with respect to it's usage or its effect -# upon hardware or computer systems, and maintains copyright as set out -# in the "LICENCE" document which accompanies distributions of Crack v4.0 -# and upwards. -### - -### Use zcat to read compressed (as well as uncompressed) dictionaries. -### Compressed dictionaries can save quite a lot of disk space. -CAT="gzip -cdf" -###CAT="zcat" -###CAT="cat" - -### in case of explosion, invoke "sort" with "-T" option pointing to a lot -### of free space in a directory somewhere. - -SORT="sort" -###SORT="sort -T /tmp" - -$CAT $* | - tr '[A-Z]' '[a-z]' | - tr -cd '\012[a-z][0-9]' | - $SORT | - uniq | - grep -v '^#' | - grep -v '^$' diff --git a/cracklib/util/packer.c b/cracklib/util/packer.c index 76d9591..e921d13 100644 --- a/cracklib/util/packer.c +++ b/cracklib/util/packer.c @@ -18,16 +18,27 @@ main(argc, argv) int32 wrote; PWDICT *pwp; char buffer[STRINGSIZE]; + char *file; if (argc <= 1) + { + file = DEFAULT_CRACKLIB_DICT; + } + else + { + file = argv[1]; + } + + if ( argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) ) { fprintf(stderr, "Usage:\t%s dbname\n", argv[0]); + fprintf(stderr, " if dbname is not specified, will use compiled in default of (%s).", DEFAULT_CRACKLIB_DICT); return (-1); } - if (!(pwp = PWOpen(argv[1], "w"))) + if (!(pwp = PWOpen(file, "w"))) { - perror(argv[1]); + perror(file); return (-1); }