Cracklib

From CBLFS
Revision as of 23:51, 5 January 2007 by Kalessin (talk | contribs) (I added a note about rebuilding Shadow.)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Download Source:
http://prdownloads.sourceforge.net/cracklib/cracklib-2.8.22.tar.gz
http://prdownloads.sourceforge.net/cracklib/cracklib-words.gz (Recommended word list for English-speaking countries)
Download Optional Patch: http://www.linuxfromscratch.org/patches/blfs/svn/cracklib-2.8.22-heimdal-1.patch (Required patch to create a library used with the Heimdal Kerberos 5 package)

Introduction to CrackLib

The CrackLib package contains a library used to enforce strong passwords by comparing user selected passwords to words in chosen word lists.

Important Note:
After installing Cracklib, you will need to reinstall Shadow
if you want to have strong password support on your system.
However, since Linux-PAM also requires you to rebuild
Shadow, you might as well wait until after you've built
Linux-PAM if you intend to install that package on your
system as well.

Dependencies

Optional

Non-Multilib

If desired, apply the Heimdal patch (note that with this patch the original library is not affected; this patch only creates an additional library used by the Heimdal password-checking routines):

patch -Np1 -i ../cracklib-2.8.22-heimdal-1.patch

Configure and compile the package:

./configure --prefix=/usr -with-default-dict=/lib/cracklib/pw_dict &&
make

Install the package:

make install &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut  -f2 -d" ") &&
mv /usr/lib/$LIBNAME /lib &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut -f1 -d" ") &&
mv /usr/lib/$LIBNAME /lib &&
ln -sf ../../lib/$LIBNAME /usr/lib/libcrack.so

Install the dictionary:

install -m644 -D ../cracklib-words.gz /usr/share/dict/cracklib-words.gz
gunzip -f /usr/share/dict/cracklib-words.gz
ln -sf cracklib-words /usr/share/dict/words
echo $(hostname) >>/usr/share/dict/cracklib-extra-words &&
install -m755 -d /lib/cracklib
create-cracklib-dict /usr/share/dict/cracklib-words /usr/share/dict/cracklib-extra-words

Multilib

If desired, apply the Heimdal patch (note that with this patch the original library is not affected; this patch only creates an additional library used by the Heimdal password-checking routines):

patch -Np1 -i ../cracklib-2.8.22-heimdal-1.patch

32Bit

Configure and compile the package:

CC="gcc ${BUILD32}" USE_ARCH=32 ./configure --prefix=/usr -with-default-dict=/lib/cracklib/pw_dict &&
make

Install the package:

make install &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut -f2 -d" ") &&
mv /usr/lib/$LIBNAME /lib &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut -f1 -d" ") &&
mv /usr/lib/$LIBNAME /lib &&
ln -sf ../../lib/$LIBNAME /usr/lib/libcrack.so

N32

Configure and compile the package:

CC="gcc ${BUILDN32}" USE_ARCH=n32 ./configure --prefix=/usr \
  --libdir=/usr/lib32 -with-default-dict=/lib/cracklib/pw_dict &&
make

Install the package:

make install &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut -f2 -d" ") &&
mv /usr/lib/$LIBNAME /lib32 &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut -f1 -d" ") &&
mv /usr/lib/$LIBNAME /lib32 &&
ln -sf ../../lib/$LIBNAME /usr/lib32/libcrack.so

64Bit

Configure and compile the package:

CC="gcc ${BUILDN64}" USE_ARCH=64 ./configure --prefix=/usr \
  --libdir=/usr/lib64 -with-default-dict=/lib/cracklib/pw_dict &&
make

Install the package:

make install &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut -f2 -d" ") &&
mv /usr/lib/$LIBNAME /lib64 &&
LIBNAME=$(cat lib/libcrack.la | grep library_names | cut -f2 -d"'" | cut -f1 -d" ") &&
mv /usr/lib/$LIBNAME /lib64 &&
ln -sf ../../lib/$LIBNAME /usr/lib64/libcrack.so

Install the dictionary:

install -m644 -D ../cracklib-words.gz /usr/share/dict/cracklib-words.gz
gunzip -f /usr/share/dict/cracklib-words.gz
ln -sf cracklib-words /usr/share/dict/words
install -m755 -d /lib/cracklib
create-cracklib-dict /usr/share/dict/cracklib-words /usr/share/dict/cracklib-extra-words

Contents

Installed Programs: cracklib-check, cracklib-format, cracklib-packer, cracklib-unpacker, create-cracklib-dict
Installed Libraries: libcrack.{so,a}, libcrack_heimdal.{so,a}, cracklibmodule.{so,a} Python Modules
Installed Directories: /lib/cracklib, /usr/share/dict, /usr/share/cracklib

Short Descriptions

create-cracklib-dict is used to create the CrackLib dictionary from the given word list(s).
libcrack.{so,a} provides a fast dictionary lookup method for strong password enforcement.