7ae832c
Summary:   Password cracker
7ae832c
Name:      crack
7ae832c
Version:   5.0a
587410b
Release:   2%{?dist}
7ae832c
License:   Artistic
7ae832c
Group:     Applications/System
7ae832c
Source:    ftp://ftp.cerias.purdue.edu/pub/tools/unix/pwdutils/crack/%{name}5.0.tar.gz
7ae832c
Patch:     %{name}-chris.patch
7ae832c
URL:       http://www.crypticide.com/users/alecm/security/c50-faq.html
7ae832c
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
7ae832c
BuildRequires: words
7ae832c
7ae832c
%description
7ae832c
Crack is a password guessing program that is designed to quickly locate
7ae832c
insecurities in Unix (or other) password files by scanning the contents of a
7ae832c
password file, looking for users who have misguidedly chosen a weak login
7ae832c
password.
7ae832c
7ae832c
This package creates a group named "crack" and the Crack program puts all
7ae832c
its results in the /var/lib/crack/run directory, which belongs to that group.
7ae832c
Only users in the crack group can use this package.
7ae832c
7ae832c
7ae832c
%prep
7ae832c
%setup -q -n c50a
7ae832c
# Make sure we do not use libdes
7ae832c
rm -rf src/libdes
7ae832c
# select proper crypt routine and related checks
7ae832c
rm -f src/util/elcid.c
7ae832c
ln src/util/elcid.c,bsd src/util/elcid.c
7ae832c
mkdir run bin
7ae832c
# Try not to pollute bin namespace
7ae832c
sed -i -e 's/Reporter/CrackReporter/g' doc/gui.txt manual.html manual.txt
7ae832c
%patch -p1 -b .chris
7ae832c
sed -i 's|/usr/dict/|/usr/share/dict/|g' conf/dictgrps.conf
7ae832c
7ae832c
7ae832c
%build
7ae832c
C5FLAGS="-D_XOPEN_SOURCE -DUSE_STRING_H -DUSE_STDLIB_H -DUSE_SIGNAL_H -DUSE_SYS_TYPES_H -DUSE_UNISTD_H -DUSE_PWD_H"
7ae832c
make XDIR=../../bin XCC=gcc XCFLAGS="$RPM_OPT_FLAGS $C5FLAGS" XLIBS=-lcrypt utils
7ae832c
CRACK_HOME=. ./Crack -makedict
7ae832c
7ae832c
7ae832c
%install
7ae832c
rm -rf $RPM_BUILD_ROOT
7ae832c
rm -f bin/libc5.a bin/stdlib-cracker
7ae832c
mkdir -p $RPM_BUILD_ROOT/var/lib/crack
7ae832c
cp -a bin conf dict run scripts $RPM_BUILD_ROOT/var/lib/crack
7ae832c
install -D Crack $RPM_BUILD_ROOT%{_bindir}/Crack
7ae832c
install Reporter $RPM_BUILD_ROOT%{_bindir}/CrackReporter
7ae832c
7ae832c
7ae832c
%clean
7ae832c
rm -rf $RPM_BUILD_ROOT
7ae832c
7ae832c
7ae832c
%pre
7ae832c
if [ $1 -eq 1 ]; then
7ae832c
    groupadd -r crack >/dev/null 2>&1 || :
7ae832c
fi
7ae832c
7ae832c
7ae832c
%files
7ae832c
%defattr(-, root, root)
7ae832c
%doc LICENCE manual.* doc
7ae832c
%attr(00750, root, crack) %{_bindir}/*
7ae832c
%dir /var/lib/crack/
7ae832c
/var/lib/crack/bin/
7ae832c
/var/lib/crack/conf/
7ae832c
/var/lib/crack/dict/
7ae832c
/var/lib/crack/scripts/
7ae832c
%attr(02770, root, crack) %dir /var/lib/crack/run/
7ae832c
%attr(02770, root, crack) %dir /var/lib/crack/run/dict/
7ae832c
%attr(00640, root, crack) /var/lib/crack/run/dict/*
7ae832c
%attr(00640, root, crack) /var/lib/crack/run/dict/.dictmade
7ae832c
7ae832c
7ae832c
%changelog
587410b
* Thu May 10 2007 Christian Iseli <Christian.Iseli@licr.org> 5.0a-2
587410b
- Fix #239575: crack uses obsolete sort option syntax
587410b
7ae832c
* Tue Sep 06 2005 Tom "spot" Callaway <tcallawa@redhat.com> 5.0a-1
7ae832c
- use words to make a richer dict 1
7ae832c
7ae832c
* Tue Sep 06 2005 Christian Iseli <Christian.Iseli@licr.org> 5.0a-0
7ae832c
- Created spec file.