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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
diff -N -r -U3 cracklib,2.7.orig/Makefile cracklib,2.7/Makefile
--- cracklib,2.7.orig/Makefile Wed Dec 31 11:33:53 1997
+++ cracklib,2.7/Makefile Tue Feb 27 16:03:32 2001
@@ -7,14 +7,21 @@
###
###
+# cracklib version
+MAJOR=2
+MINOR=7
+VERSION=$(MAJOR).$(MINOR)
+export MAJOR MINOR VERSION
+
+###
# set this to the absolute path (less extn) of compressed dict.
-DICTPATH="/usr/local/lib/pw_dict"
+DICTPATH="/usr/lib/cracklib_dict"
###
# Set this to the path of one or more files continaing wordlists.
-SRCDICTS=/usr/dict/words
+SRCDICTS=/usr/share/dict/words /usr/share/dict/extra.words
###
# If you have installed the cracklib-dicts directory, use this
@@ -36,7 +43,9 @@
-rm -f all installed Part* *.BAK *.bak *~
install: all
+ ( cd cracklib && make install && exit $$? )
+ ( cd util && make install && exit $$? )
@echo 'if "sort" dies from lack of space, see "util/mkdict"'
- util/mkdict $(SRCDICTS) | util/packer $(DICTPATH)
+ util/mkdict $(SRCDICTS) | LD_LIBRARY_PATH=cracklib util/packer $(DESTDIR)$(DICTPATH)
touch installed
### @echo 'now go install passwd/passwd where you want it'
diff -N -r -U3 cracklib,2.7.orig/cracklib/Makefile cracklib,2.7/cracklib/Makefile
--- cracklib,2.7.orig/cracklib/Makefile Sun Dec 14 23:49:21 1997
+++ cracklib,2.7/cracklib/Makefile Tue Feb 27 16:03:39 2001
@@ -6,13 +6,20 @@
# and upwards.
###
-LIB= libcrack.a
-OBJ= fascist.o packlib.o rules.o stringlib.o
-CFLAGS= -O -I../cracklib -DIN_CRACKLIB
+LIB = libcrack.so
+OBJ = fascist.o packlib.o rules.o stringlib.o
+CFLAGS += -g -I../cracklib -DIN_CRACKLIB -fPIC
-$(LIB): $(OBJ)
- ar rv $(LIB) $?
- -ranlib $(LIB)
+$(LIB): $(OBJ) Makefile
+ $(LD) -shared -soname $(LIB).$(MAJOR) -o $(LIB).$(VERSION) $(OBJ) -lc
+ rm -f $(LIB).$(MAJOR) $(LIB)
+ ln -s $(LIB).$(VERSION) $(LIB).$(MAJOR)
+ ln -s $(LIB).$(MAJOR) $(LIB)
clean:
- -rm -f $(OBJ) $(LIB) *~
+ -rm -f $(OBJ) $(LIB) $(LIB).$(VERSION) *~
+
+install: $(LIB) crack.h
+ install -m 755 $(LIB).$(VERSION) $(DESTDIR)/usr/lib
+ ln -sf $(LIB).$(VERSION) $(DESTDIR)/usr/lib/$(LIB)
+ install -m 644 crack.h $(DESTDIR)/usr/include
diff -N -r -U3 cracklib,2.7.orig/util/Makefile cracklib,2.7/util/Makefile
--- cracklib,2.7.orig/util/Makefile Sun Dec 14 23:49:34 1997
+++ cracklib,2.7/util/Makefile Tue Feb 27 16:03:46 2001
@@ -14,27 +14,31 @@
#SunOS users (and others?) should consider static linking of their passwd binary
#CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"' -Bstatic
-CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"'
-LIBS= ../cracklib/libcrack.a
+CFLAGS += -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"'
+LDFLAGS = -L../cracklib -lcrack
+LIBS = ../cracklib/libcrack.so
all: packer unpacker testnum teststr testlib
touch all
packer: packer.o $(LIBS)
- cc $(CFLAGS) -o $@ $@.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
unpacker: unpacker.o $(LIBS)
- cc $(CFLAGS) -o $@ $@.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
testnum: testnum.o $(LIBS)
- cc $(CFLAGS) -o $@ $@.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
teststr: teststr.o $(LIBS)
- cc $(CFLAGS) -o $@ $@.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
testlib: testlib.o $(LIBS)
- cc $(CFLAGS) -o $@ $@.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
clean:
-rm *.o *~ all
-rm teststr testnum testlib packer unpacker
+
+install: all create-cracklib-dict
+ install -m 755 mkdict packer create-cracklib-dict $(DESTDIR)/usr/sbin
diff -N -r -U3 cracklib,2.7.orig/util/create-cracklib-dict cracklib,2.7/util/create-cracklib-dict
--- cracklib,2.7.orig/util/create-cracklib-dict Thu Jan 1 01:00:00 1970
+++ cracklib,2.7/util/create-cracklib-dict Tue Feb 27 16:03:51 2001
@@ -0,0 +1,15 @@
+#!/bin/sh
+if [ -z "$*" ]; then
+ echo "Usage:"
+ echo " /usr/sbin/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 "/usr/lib/cracklib_dict.*"
+ echo
+ echo "Example:"
+ echo "/usr/sbin/create-cracklib-dict /usr/dict/words"
+else
+ /usr/sbin/mkdict $* | /usr/sbin/packer /usr/share/cracklib/pw_dict
+fi
|