source:
scripts/patches/cracklib,2.7-blfs-1.patch@
eab3ca9
Last change on this file since eab3ca9 was 7f65c0e, checked in by , 19 years ago | |
---|---|
|
|
File size: 6.0 KB |
-
cracklib,2.
Submitted By: Jim Gifford (jim at linuxfromscratch dot org) Date: 2004-04-22 Initial Package Version: 2,7 Origin: Jim Gifford & DJ Lucas Description: Makes Cracklib a dynamic library installed at /lib Fixes buffer underruns Add's missing header Install's Missing Headers diff -Naur cracklib,2.7-orig/Makefile cracklib,2.7/Makefile
old new 7 7 ### 8 8 9 9 ### 10 # cracklib version 11 MAJOR=2 12 MINOR=7 13 VERSION=$(MAJOR).$(MINOR) 14 export MAJOR MINOR VERSION 15 16 ### 10 17 # set this to the absolute path (less extn) of compressed dict. 11 18 12 DICTPATH="/ usr/local/lib/pw_dict"19 DICTPATH="/lib/cracklib_dict" 13 20 14 21 ### 15 22 # Set this to the path of one or more files continaing wordlists. 16 23 17 SRCDICTS=/usr/ dict/words24 SRCDICTS=/usr/share/dict/words /usr/share/dict/extra.words 18 25 19 26 ### 20 27 # If you have installed the cracklib-dicts directory, use this … … 36 43 -rm -f all installed Part* *.BAK *.bak *~ 37 44 38 45 install: all 46 ( cd cracklib && make install && exit $$? ) 47 ( cd util && make install && exit $$? ) 39 48 @echo 'if "sort" dies from lack of space, see "util/mkdict"' 40 util/mkdict $(SRCDICTS) | util/packer$(DICTPATH)49 util/mkdict $(SRCDICTS) | LD_LIBRARY_PATH=cracklib util/packer $(DESTDIR)$(DICTPATH) 41 50 touch installed 42 51 ### @echo 'now go install passwd/passwd where you want it' -
cracklib/Makefile
diff -Naur cracklib,2.7-orig/cracklib/Makefile cracklib,2.7/cracklib/Makefile
old new 6 6 # and upwards. 7 7 ### 8 8 9 LIB= libcrack.a 10 OBJ= fascist.o packlib.o rules.o stringlib.o 11 CFLAGS= -O -I../cracklib -DIN_CRACKLIB 9 LIB = libcrack.so 10 OBJ = fascist.o packlib.o rules.o stringlib.o 11 CFLAGS += -g -I../cracklib -DIN_CRACKLIB -fPIC 12 LD = ld 12 13 13 $(LIB): $(OBJ) 14 ar rv $(LIB) $? 15 -ranlib $(LIB) 14 $(LIB): $(OBJ) Makefile 15 $(LD) -shared -soname $(LIB).$(MAJOR) -o $(LIB).$(VERSION) $(OBJ) -lc 16 rm -f $(LIB).$(MAJOR) $(LIB) 17 ln -s $(LIB).$(VERSION) $(LIB).$(MAJOR) 18 ln -s $(LIB).$(MAJOR) $(LIB) 16 19 17 20 clean: 18 -rm -f $(OBJ) $(LIB) *~ 21 -rm -f $(OBJ) $(LIB) $(LIB).$(VERSION) *~ 22 23 install: $(LIB) crack.h 24 install -m 755 $(LIB).$(VERSION) $(DESTDIR)/lib 25 ln -sf $(LIB).$(VERSION) $(DESTDIR)/lib/$(LIB) 26 ln -sf $(DESTDIR)/lib/$(LIB).$(VERSION) $(DESTDIR)/lib/$(LIB).$(MAJOR) 27 28 install -m 644 packer.h $(DESTDIR)/usr/include 29 install -m 644 crack.h $(DESTDIR)/usr/include -
cracklib/crack.h
diff -Naur cracklib,2.7-orig/cracklib/crack.h cracklib,2.7/cracklib/crack.h
old new 1 2 #ifndef CRACKLIB_H 3 #define CRACKLIB_H 4 5 /* Pass this function a password (pw) and a path to the 6 * dictionaries (/lib/cracklib_dict should be specified) 7 * and it will either return a NULL string, meaning that the 8 * password is good, or a pointer to a string that explains the 9 * problem with the password. 10 * You must link with -lcrack 11 */ 12 13 extern char *FascistCheck(char *pw, char *dictpath); 14 15 #endif -
cracklib/fascist.c
diff -Naur cracklib,2.7-orig/cracklib/fascist.c cracklib,2.7/cracklib/fascist.c
old new 11 11 #include "packer.h" 12 12 #include <sys/types.h> 13 13 #include <pwd.h> 14 #include <string.h> 14 15 15 16 #define ISSKIP(x) (isspace(x) || ispunct(x)) 16 17 … … 659 660 return ("it does not contain enough DIFFERENT characters"); 660 661 } 661 662 662 strcpy(password, Lowercase(password));663 strcpy(password, (char *)Lowercase(password)); 663 664 664 665 Trim(password); 665 666 … … 722 723 } 723 724 } 724 725 725 strcpy(password, Reverse(password));726 strcpy(password, (char *)Reverse(password)); 726 727 727 728 for (i = 0; r_destructors[i]; i++) 728 729 { -
util/Makefile
diff -Naur cracklib,2.7-orig/util/Makefile cracklib,2.7/util/Makefile
old new 14 14 #SunOS users (and others?) should consider static linking of their passwd binary 15 15 #CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"' -Bstatic 16 16 17 CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"' 18 LIBS= ../cracklib/libcrack.a 17 CFLAGS += -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"' 18 LDFLAGS = -L../cracklib -lcrack 19 LIBS = ../cracklib/libcrack.so 19 20 20 21 all: packer unpacker testnum teststr testlib 21 22 touch all 22 23 23 24 packer: packer.o $(LIBS) 24 cc $(CFLAGS) -o $@ $@.o $(LIBS)25 $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS) 25 26 26 27 unpacker: unpacker.o $(LIBS) 27 cc $(CFLAGS) -o $@ $@.o $(LIBS)28 $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS) 28 29 29 30 testnum: testnum.o $(LIBS) 30 cc $(CFLAGS) -o $@ $@.o $(LIBS)31 $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS) 31 32 32 33 teststr: teststr.o $(LIBS) 33 cc $(CFLAGS) -o $@ $@.o $(LIBS)34 $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS) 34 35 35 36 testlib: testlib.o $(LIBS) 36 cc $(CFLAGS) -o $@ $@.o $(LIBS)37 $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS) 37 38 38 39 clean: 39 40 -rm *.o *~ all 40 41 -rm teststr testnum testlib packer unpacker 42 43 install: all create-cracklib-dict 44 install -m 755 mkdict packer create-cracklib-dict $(DESTDIR)/usr/sbin -
util/create-cracklib-dict
diff -Naur cracklib,2.7-orig/util/create-cracklib-dict cracklib,2.7/util/create-cracklib-dict
old new 1 #!/bin/sh 2 if [ -z "$*" ]; then 3 echo "Usage:" 4 echo " /usr/sbin/create-cracklib-dict wordlist ..." 5 echo 6 echo "This script takes one or more word list files as arguments" 7 echo "and converts them into cracklib dictionaries for use" 8 echo "by password checking programs. The results are placed in" 9 echo "/lib/cracklib_dict.*" 10 echo 11 echo "Example:" 12 echo "/usr/sbin/create-cracklib-dict /usr/dict/words" 13 else 14 /usr/sbin/mkdict $* | /usr/sbin/packer /usr/share/cracklib/pw_dict 15 fi
Note:
See TracBrowser
for help on using the repository browser.