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
|
--- extconf.rb.orig Wed Jun 19 09:29:52 2002
+++ extconf.rb Fri Sep 20 04:47:59 2002
@@ -4,34 +4,44 @@
require 'mkmf'
-CRACK_DICT = 'cracklib_dict.pwd'
+search_dicts = %w(
+/usr/local/lib/pw_dict.pwd
+/usr/lib/pw_dict.pwd
+/opt/lib/pw_dict.pwd
+/usr/local/lib/cracklib_dict.pwd
+/usr/lib/cracklib_dict.pwd
+/opt/lib/cracklib_dict.pwd
+)
-dict = []
-search_dirs = %w(/usr/local /usr /opt)
+if dict = with_config('crack-dict')
+ search_dicts.unshift(dict)
+end
-# find the crack dictionary
-print "checking for #{CRACK_DICT}... "
-search_dirs.each do |d|
- dict = Dir.glob(File.join(d, "lib", CRACK_DICT))
+crack_dict = nil
+# find the crack dictionary
+print "checking for cracklib dictionary... "
+search_dicts.each do |dict|
# create a header file pointing to the crack dictionary
- unless dict.empty?
- puts "yes"
- path = dict[0].sub(/\.pwd/, '')
- hfile = File.new("rbcrack.h", 'w')
- hfile.printf("#define CRACK_DICT \"%s\"\n", path)
- hfile.close
+ if File.exist?(dict)
+ puts dict
+ crack_dict = dict.sub(/\.pwd/, '')
break
end
-
end
-if dict.empty?
- puts "no\nCouldn't find #{CRACK_DICT} on this system"
+if crack_dict.nil?
+ puts "no\nCouldn't find a cracklib dictionary on this system"
exit 1
end
-have_library('crack', 'FascistCheck')
+hfile = File.new("rbcrack.h", 'w')
+hfile.printf("#define CRACK_DICT \"%s\"\n", crack_dict)
+hfile.close
+
+(have_header('packer.h') || have_header('crack.h')) &&
+ have_library('crack', 'FascistCheck') or exit 1
+
create_makefile('crack')
File.open('Makefile', 'a') do |f|
|