# CrackLib
# ========
# I include two versions below. The latest version available (2.7) from
# what I think is the author's site, and the latest version available from
# the SourceForge project (2.8.9).
# If you're upgrading from an older version, you may want to skip down to
# the bottom to ensure that cracklib is removed before you install the new
# one. Especially if you had it installed under /usr/local before, but will
# install it under /usr now, you're going from 2.7 to 2.8.x, which doesn't
# use certain old binaries and includes new ones that the older one didn't
# have, etc.
# CrackLib 2.8.9
# ==============
cd
test -f installed/cracklib-2.8.9.tar.gz &&
mv installed/cracklib-2.8.9.tar.gz .
test ! -f cracklib-2.8.9.tar.gz &&
wget http://download.sf.net/cracklib/cracklib-2.8.9.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cracklib[,-]*" -exec rm -r {} \;
tar xzvf ~/cracklib-2.8.9.tar.gz
cd cracklib-2.8.9
test $UID = 0 && chown -R root:root .
# Grab a word list:
test -f ~/installed/cracklib-words.gz &&
mv ~/installed/cracklib-words.gz .
wget -N http://download.sf.net/cracklib/cracklib-words.gz
./configure --prefix=/usr
make
# Become root to clean up old files and to install it
su
make install
chown -R $USER .
# Install a word list:
test -f ./cracklib-words.gz &&
zcat ./cracklib-words.gz > /usr/share/cracklib/pw_dict
test ! -f /usr/share/cracklib/pw_dict &&
cp dicts/cracklib-small /usr/share/cracklib/pw_dict
# Convert the wordlist into cracklib dictionaries:
/usr/sbin/create-cracklib-dict /usr/share/cracklib/pw_dict
# Become yourself again
exit
cd
mkdir -p -m 0700 installed
test -f src/cracklib-2.8.9/cracklib-words.gz &&
mv src/cracklib-2.8.9/cracklib-words.gz installed/
rm -f installed/cracklib,*.tar.* installed/cracklib-*.tar.*
mv cracklib-2.8.9.tar.gz installed/
# CrackLib 2.7
# ============
cd
test -f installed/cracklib,2.7.tar.gz &&
mv installed/cracklib,2.7.tar.gz .
test ! -f cracklib,2.7.tar.gz &&
wget http://www.crypticide.com/users/alecm/security/cracklib,2.7.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cracklib[,-]*" -exec rm -r {} \;
tar xzvf ~/cracklib,2.7.tar.gz
cd cracklib,2.7
test $UID = 0 && chown -R root:root .
# The tarball seems to be missing crack.h This crack.h came from my Fedora
# installation:
test ! -f cracklib/crack.h &&
wget http://englanders.cc/pub/linux/misc/notmine/crack.h -O cracklib/crack.h
# Install a word list:
mkdir -p /usr/share/cracklib
test -f ./cracklib-words.gz &&
zcat ./cracklib-words.gz > /usr/share/cracklib/pw_dict
test ! -f /usr/share/cracklib/pw_dict &&
cp dicts/cracklib-small /usr/share/cracklib/pw_dict
test ! -f /usr/share/cracklib/pw_dict &&
test -f /usr/share/dict/words &&
cp /usr/share/dict/words /usr/share/cracklib/pw_dict
make all SRCDICTS=/usr/share/cracklib/pw_dict
# Become root to install it
su
make install SRCDICTS=/usr/share/cracklib/pw_dict
install -m 644 cracklib/crack.h cracklib/packer.h /usr/local/include/
install -m 644 cracklib/libcrack.a /usr/local/lib/
install util/mkdict /usr/local/bin/
install -s util/packer util/unpacker /usr/local/bin/