7ae832
--- c50a/src/util/Makefile.chris	1996-12-16 09:27:35.000000000 +0100
2ab275
+++ c50a/src/util/Makefile	2007-05-10 13:46:45.000000000 +0200
7ae832
@@ -17,7 +17,7 @@
7ae832
 EXE=    $(XDIR)/dawg \
7ae832
 	$(XDIR)/dictfilt \
7ae832
 	$(XDIR)/kickdict \
7ae832
-	$(XDIR)/cracker
7ae832
+	$(XDIR)/stdlib-cracker
7ae832
 
7ae832
 #------------------------------------------------------------------
7ae832
 
7ae832
@@ -69,7 +69,7 @@
7ae832
 #------------------------------------------------------------------
7ae832
 
7ae832
 # don't you just love dependency graphs?
7ae832
-$(XDIR)/dictfilt: dictfilt.c $(XLIB) $(XDIR)/cracker
7ae832
+$(XDIR)/dictfilt: dictfilt.c $(XLIB) $(XDIR)/stdlib-cracker
7ae832
 	$(CC) $(CFLAGS) -o $(XDIR)/dictfilt dictfilt.c elcid.o $(XLIB)
7ae832
 
7ae832
 #------------------------------------------------------------------
7ae832
--- c50a/src/util/cracker.c.chris	1996-12-16 16:20:03.000000000 +0100
2ab275
+++ c50a/src/util/cracker.c	2007-05-10 13:46:45.000000000 +0200
7ae832
@@ -11,6 +11,7 @@
7ae832
 
7ae832
 #include "libcrack.h"
7ae832
 #include "elcid.h"
7ae832
+#include <stdarg.h>
7ae832
 
7ae832
 #define CRACK_MEMSMALL          0x0001
7ae832
 #define CRACK_DISKSMALL         0x0002
7ae832
@@ -97,18 +98,23 @@
7ae832
 
7ae832
 /* ------------------------------------------------------------------ */
7ae832
 
7ae832
+#ifdef __GNUC__
7ae832
 void
7ae832
-Logger(key, fmt, a, b, c, d, e, f)
7ae832
-char key;
7ae832
-char *fmt;
7ae832
-char *a, *b, *c, *d, *e, *f;
7ae832
+Logger(char key, const char *fmt, ...)
7ae832
+    __attribute__ ((format (printf, 2, 3)));
7ae832
+#endif
7ae832
+void
7ae832
+Logger(char key, const char *fmt, ...)
7ae832
 {
7ae832
     long t;
7ae832
+    va_list ap;
7ae832
 
7ae832
     time(&t);
7ae832
 
7ae832
     fprintf(stdout, "%c:%ld:", key, t);
7ae832
-    fprintf(stdout, fmt, a, b, c, d, e, f);
7ae832
+    va_start(ap, fmt);
7ae832
+    vprintf(fmt, ap);
7ae832
+    va_end(ap);
7ae832
 
7ae832
     fflush(stdout);
7ae832
     fflush(stderr);		/* and why not ? */
7ae832
--- c50a/Crack.chris	1996-12-21 02:09:41.000000000 +0100
2ab275
+++ c50a/Crack	2007-05-10 13:52:31.000000000 +0200
7ae832
@@ -1,4 +1,4 @@
7ae832
-#!/bin/sh
7ae832
+#!/bin/bash
7ae832
 ###
7ae832
 # This program was written by and is copyright Alec Muffett 1991,
7ae832
 # 1992, 1993, 1994, 1995, and 1996, and is provided as part of the
7ae832
@@ -12,85 +12,11 @@
7ae832
 # User-configurable junk for Crack
7ae832
 ###
7ae832
 
7ae832
-# nice, generic path (RedHat Linux, Solaris1, Solaris2)
7ae832
-CRACK_PATH=/usr/local/bin:/usr/ccs/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/ucb:/usr/etc:$PATH
7ae832
-
7ae832
-# compiler options for crack 5.0
7ae832
-#
7ae832
-# -DUSE_BZERO        /* add this to C5FLAGS if you don't have memset() */
7ae832
-# -DUSE_MALLOC_H
7ae832
-# -DUSE_PWD_H
7ae832
-# -DUSE_SIGNAL_H
7ae832
-# -DUSE_STDLIB_H
7ae832
-# -DUSE_STRINGS_H
7ae832
-# -DUSE_STRING_H
7ae832
-# -DUSE_SYS_TYPES_H
7ae832
-# -DUSE_UNISTD_H
7ae832
-# -DMAXWORDLEN=      /* ignore if you don't read the code */
7ae832
-# -DNUMWORDS=        /* ignore if you don't read the code */
7ae832
-# -DSTRINGSIZE=      /* ignore if you don't read the code */
7ae832
-
7ae832
-# this set tested on:
7ae832
-# - solaris 2.5
7ae832
-# - redhat linux 4.0
7ae832
-# - digital unix v4.0
7ae832
-
7ae832
-C5FLAGS="-DUSE_STRING_H -DUSE_STDLIB_H -DUSE_SIGNAL_H -DUSE_SYS_TYPES_H -DUSE_UNISTD_H -DUSE_PWD_H"
7ae832
-
7ae832
-#
7ae832
-# now pick your compiler
7ae832
-#
7ae832
-
7ae832
-# vanilla unix cc
7ae832
-CC=cc
7ae832
-CFLAGS="-g -O $C5FLAGS"
7ae832
-#LIBS=-lcrypt # uncomment only if necessary to use stdlib crypt(), eg: NetBSD MD5
7ae832
-
7ae832
-# gcc 2.7.2
7ae832
-#CC=gcc
7ae832
-#CFLAGS="-g -O2 -Wall $C5FLAGS"
7ae832
-#LIBS=-lcrypt # uncomment only if necessary to use stdlib crypt(), eg: NetBSD MD5
7ae832
-
7ae832
-# digital unix v4.0, CFLAGS for ev4/ev5 chipsets (pick one)
7ae832
-#CC=cc
7ae832
-#CFLAGS="-O4 -fast -tune ev4 $C5FLAGS"
7ae832
-#CFLAGS="-O4 -fast -tune ev5 $C5FLAGS"
7ae832
-#LIBS=
7ae832
-
7ae832
-# Uncomment the next two lines if a) you are running Crack in
7ae832
-# networking mode, and b) your environment's operating system will not
7ae832
-# necessarily run binaries compiled on other revs of the same
7ae832
-# operating system which have the same architecture and the same
7ae832
-# *MAJOR* revision number.
7ae832
-#
7ae832
-# eg: if you have Foonix 2.0 boxes as well as Foonix 2.1 boxes; in
7ae832
-# this example, the major revision number is "2".  If the Foonix 2.1
7ae832
-# O/S will not run Foonix 2.0 binaries for some reason, or vice-versa,
7ae832
-# then uncomment these lines.
7ae832
-
7ae832
-#STRICT_OSREV=yes
7ae832
-#export STRICT_OSREV
7ae832
-
7ae832
-# Uncomment and/or modify on HP/UX or similar where the UCB "rsh"
7ae832
-# command has been renamed.  See scripts/crack-rsh also
7ae832
-#CRACK_RSH=remsh
7ae832
-#CRACK_RCP=rcp
7ae832
-
7ae832
-###########################################################
7ae832
-###########################################################
7ae832
-#################### THAT'S ALL, FOLKS ####################
7ae832
-#### NOW GO CONFIGURE YOUR CRYPT ALGORITHM, EG: LIBDES ####
7ae832
-###########################################################
7ae832
-###########################################################
7ae832
-
7ae832
 ###
7ae832
 # security
7ae832
 ###
7ae832
 
7ae832
 umask 077
7ae832
-export CRACK_PATH                       # So it can be picked up later
7ae832
-PATH=$CRACK_PATH                        # For temporary use...
7ae832
-export PATH
7ae832
 
7ae832
 ###
7ae832
 # Defaults
7ae832
@@ -108,12 +34,9 @@
7ae832
 # home base
7ae832
 ###
7ae832
 
7ae832
-CRACK_HOME=`echo $0 | sed -e 's/Crack$//'`
7ae832
+old_wd=`pwd`
7ae832
 
7ae832
-if [ "$CRACK_HOME" = "" ]
7ae832
-then
7ae832
-	CRACK_HOME=.
7ae832
-fi
7ae832
+CRACK_HOME=${CRACK_HOME:-"/var/lib/crack"}
7ae832
 
7ae832
 if cd $CRACK_HOME
7ae832
 then
7ae832
@@ -126,25 +49,6 @@
7ae832
 export CRACK_HOME
7ae832
 
7ae832
 ###
7ae832
-# sanity check
7ae832
-###
7ae832
-
7ae832
-if [ ! -f "$CRACK_HOME/Crack" ]
7ae832
-then
7ae832
-	echo "Fatal Error: $CRACK_HOME: something weird going down" 1>&2
7ae832
-	exit 1
7ae832
-fi
7ae832
-
7ae832
-###
7ae832
-# Hierarchy
7ae832
-###
7ae832
-
7ae832
-for dir in run run/bin
7ae832
-do
7ae832
-	test -d $dir || mkdir $dir || exit 1
7ae832
-done
7ae832
-
7ae832
-###
7ae832
 # Flagwaving
7ae832
 ###
7ae832
 
7ae832
@@ -158,8 +62,6 @@
7ae832
 # Parse Arguments
7ae832
 ###
7ae832
 
7ae832
-argbackup1="$*"
7ae832
-
7ae832
 while [ "x$1" != "x" ]
7ae832
 do
7ae832
 	case $1 in
7ae832
@@ -275,50 +177,24 @@
7ae832
 	exit 1
7ae832
 fi
7ae832
 
7ae832
-###
7ae832
-# Sanity test bindir - written in gruntscript for clarity.
7ae832
-###
7ae832
-
7ae832
-bdname=`scripts/binstamp 2>/dev/null`
7ae832
-
7ae832
-if [ "x$bdname" = "x" ]
7ae832
-then
7ae832
-	echo "Crack: error: cannot continue as binstamp returned empty string" 1>&2
7ae832
-	exit 0
7ae832
-fi
7ae832
-
7ae832
-echo "Stamp: $bdname"
7ae832
 echo ""
7ae832
 
7ae832
 
7ae832
 if [ "x$1" != "x" ]
7ae832
 then
7ae832
-	if [ "$1" = "-fmt" ]            # use generic name
7ae832
-	then
7ae832
-		bindir=run/bin/$bdname
7ae832
-	elif [ -d run/bin/$1 ]          # have been here before
7ae832
-	then
7ae832
-		bindir=run/bin/$1
7ae832
-		shift
7ae832
-	elif [ ! -f $1 ]                # use specified name
7ae832
-	then
7ae832
-		bindir=run/bin/$1
7ae832
-		shift
7ae832
-	else                            # use generic name
7ae832
-		bindir=run/bin/$bdname
7ae832
-	fi
7ae832
+	bindir=bin
7ae832
 else                                    # supporting "-makeonly"
7ae832
 	if [ "$makeonlyflag" != "" ]
7ae832
 	then
7ae832
-		bindir=run/bin/$bdname
7ae832
+		bindir=bin
7ae832
 
7ae832
 	elif [ "$makedictflag" != "" ]
7ae832
 	then
7ae832
-		bindir=run/bin/$bdname
7ae832
+		bindir=bin
7ae832
 
7ae832
 	elif [ "$remoteflag" != "" ]
7ae832
 	then
7ae832
-		bindir=run/bin/$bdname
7ae832
+		bindir=bin
7ae832
 	else
7ae832
 		echo $usage 1>&2
7ae832
 		exit 1
7ae832
@@ -333,21 +209,6 @@
7ae832
 export PATH
7ae832
 
7ae832
 ###
7ae832
-# Make the binaries
7ae832
-###
7ae832
-
7ae832
-echo "Crack: making utilities in $bindir"
7ae832
-
7ae832
-if [ ! -d $bindir ] # small redundancy, big benefit
7ae832
-then
7ae832
-	mkdir $bindir || exit 1
7ae832
-fi
7ae832
-
7ae832
-make clean || exit 1
7ae832
-
7ae832
-make ARGS="\"XDIR=../../$bindir\" \"XCFLAGS=$CFLAGS\" \"XCC=$CC\" \"XLIBS=$LIBS\"" utils || exit 1
7ae832
-
7ae832
-###
7ae832
 # Make Only ?
7ae832
 ###
7ae832
 
7ae832
@@ -439,7 +300,6 @@
7ae832
 	fbmerge
7ae832
 
7ae832
 	echo "Crack: Merging password files..."
7ae832
-	argbackup2="$*"
7ae832
 
7ae832
 	(
7ae832
 		cat run/F-merged        # first the feedback
2ab275
@@ -451,16 +311,22 @@
7ae832
 				shift || exit 1
7ae832
 				deffmt=$1
7ae832
 
7ae832
-			elif [ "$deffmt" = "spf" ]
7ae832
-			then
7ae832
-				cat $1 1>&3 # skip the sort
7ae832
 			else
7ae832
-				${deffmt}2spf $1
7ae832
+			  theFile=$1
7ae832
+			  if [ ! -r $theFile ]; then
7ae832
+			    theFile="$old_wd/$theFile"
7ae832
+			  fi
7ae832
+			  if [ "$deffmt" = "spf" ]
7ae832
+			  then
7ae832
+			  	  cat $theFile 1>&3 # skip the sort
7ae832
+			  else
7ae832
+			  	  ${deffmt}2spf $theFile
7ae832
+			  fi
7ae832
 			fi
7ae832
 
7ae832
 			shift
2ab275
 		done |
2ab275
-		crack-sort -t: +1
2ab275
+		crack-sort -t: -k 2
2ab275
 	) 3>&1 |
2ab275
 	fbfilt $crackfb $crackmf > $crackin # remove feedback-guessable users
2ab275
 
7ae832
--- c50a/Reporter.chris	1996-12-13 20:13:55.000000000 +0100
2ab275
+++ c50a/Reporter	2007-05-10 13:46:45.000000000 +0200
7ae832
@@ -1,4 +1,4 @@
7ae832
-#!/bin/sh
7ae832
+#!/bin/bash
7ae832
 ###
7ae832
 # This program was written by and is copyright Alec Muffett 1991,
7ae832
 # 1992, 1993, 1994, 1995, and 1996, and is provided as part of the
7ae832
@@ -10,6 +10,9 @@
7ae832
 # document which accompanies distributions of Crack v5.0 and upwards.
7ae832
 ###
7ae832
 
7ae832
+CRACK_HOME=${CRACK_HOME:-"/var/lib/crack"}
7ae832
+cd $CRACK_HOME
7ae832
+
7ae832
 tfile=run/T$$
7ae832
 date=`date`
7ae832