source: scripts/patches/cracklib,2.7-blfs-1.patch@ 176b4b6

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 176b4b6 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100644
File size: 6.0 KB
  • cracklib,2.

    Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
    Date: 2004-04-22
    Initial Package Version: 2,7
    Origin: Jim Gifford & DJ Lucas
    Description: Makes Cracklib a dynamic library installed at /lib
                 Fixes buffer underruns
                 Add's missing header
                 Install's Missing Headers
    
    diff -Naur cracklib,2.7-orig/Makefile cracklib,2.7/Makefile
    old new  
    77###
    88
    99###
     10# cracklib version
     11MAJOR=2
     12MINOR=7
     13VERSION=$(MAJOR).$(MINOR)
     14export MAJOR MINOR VERSION
     15
     16###
    1017# set this to the absolute path (less extn) of compressed dict.
    1118
    12 DICTPATH="/usr/local/lib/pw_dict"
     19DICTPATH="/lib/cracklib_dict"
    1320
    1421###
    1522# Set this to the path of one or more files continaing wordlists.
    1623
    17 SRCDICTS=/usr/dict/words
     24SRCDICTS=/usr/share/dict/words /usr/share/dict/extra.words
    1825
    1926###
    2027# If you have installed the cracklib-dicts directory, use this
     
    3643        -rm -f all installed Part* *.BAK *.bak *~
    3744
    3845install: all
     46        ( cd cracklib && make install && exit $$? )
     47        ( cd util && make install && exit $$? )
    3948        @echo 'if "sort" dies from lack of space, see "util/mkdict"'
    40         util/mkdict $(SRCDICTS) | util/packer $(DICTPATH)
     49        util/mkdict $(SRCDICTS) | LD_LIBRARY_PATH=cracklib util/packer $(DESTDIR)$(DICTPATH)
    4150        touch installed
    4251###     @echo 'now go install passwd/passwd where you want it'
  • cracklib/Makefile

    diff -Naur cracklib,2.7-orig/cracklib/Makefile cracklib,2.7/cracklib/Makefile
    old new  
    66# and upwards.
    77###
    88
    9 LIB=    libcrack.a
    10 OBJ=    fascist.o packlib.o rules.o stringlib.o
    11 CFLAGS= -O -I../cracklib -DIN_CRACKLIB
     9LIB     = libcrack.so
     10OBJ     = fascist.o packlib.o rules.o stringlib.o
     11CFLAGS += -g -I../cracklib -DIN_CRACKLIB -fPIC
     12LD      = ld
    1213
    13 $(LIB): $(OBJ)
    14         ar rv $(LIB) $?
    15         -ranlib $(LIB)
     14$(LIB): $(OBJ) Makefile
     15        $(LD) -shared -soname $(LIB).$(MAJOR) -o $(LIB).$(VERSION) $(OBJ) -lc
     16        rm -f $(LIB).$(MAJOR) $(LIB)
     17        ln -s $(LIB).$(VERSION) $(LIB).$(MAJOR)
     18        ln -s $(LIB).$(MAJOR) $(LIB)
    1619
    1720clean:
    18         -rm -f $(OBJ) $(LIB) *~
     21        -rm -f $(OBJ) $(LIB) $(LIB).$(VERSION) *~
     22
     23install: $(LIB) crack.h
     24        install -m 755 $(LIB).$(VERSION) $(DESTDIR)/lib
     25        ln -sf $(LIB).$(VERSION) $(DESTDIR)/lib/$(LIB)
     26        ln -sf $(DESTDIR)/lib/$(LIB).$(VERSION) $(DESTDIR)/lib/$(LIB).$(MAJOR)
     27
     28        install -m 644 packer.h $(DESTDIR)/usr/include
     29        install -m 644 crack.h $(DESTDIR)/usr/include
  • cracklib/crack.h

    diff -Naur cracklib,2.7-orig/cracklib/crack.h cracklib,2.7/cracklib/crack.h
    old new  
     1
     2#ifndef CRACKLIB_H
     3#define CRACKLIB_H
     4
     5/* Pass this function a password (pw) and a path to the
     6 * dictionaries (/lib/cracklib_dict should be specified)
     7 * and it will either return a NULL string, meaning that the
     8 * password is good, or a pointer to a string that explains the
     9 * problem with the password.
     10 * You must link with -lcrack
     11 */
     12
     13extern char *FascistCheck(char *pw, char *dictpath);
     14
     15#endif
  • cracklib/fascist.c

    diff -Naur cracklib,2.7-orig/cracklib/fascist.c cracklib,2.7/cracklib/fascist.c
    old new  
    1111#include "packer.h"
    1212#include <sys/types.h>
    1313#include <pwd.h>
     14#include <string.h>
    1415
    1516#define ISSKIP(x) (isspace(x) || ispunct(x))
    1617
     
    659660        return ("it does not contain enough DIFFERENT characters");
    660661    }
    661662
    662     strcpy(password, Lowercase(password));
     663    strcpy(password, (char *)Lowercase(password));
    663664
    664665    Trim(password);
    665666
     
    722723        }
    723724    }
    724725
    725     strcpy(password, Reverse(password));
     726    strcpy(password, (char *)Reverse(password));
    726727
    727728    for (i = 0; r_destructors[i]; i++)
    728729    {
  • util/Makefile

    diff -Naur cracklib,2.7-orig/util/Makefile cracklib,2.7/util/Makefile
    old new  
    1414#SunOS users (and others?) should consider static linking of their passwd binary
    1515#CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"' -Bstatic
    1616
    17 CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"'
    18 LIBS=   ../cracklib/libcrack.a
     17CFLAGS += -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"'
     18LDFLAGS = -L../cracklib -lcrack
     19LIBS    = ../cracklib/libcrack.so
    1920
    2021all:    packer unpacker testnum teststr testlib
    2122        touch all
    2223
    2324packer: packer.o $(LIBS)
    24         cc $(CFLAGS) -o $@ $@.o $(LIBS)
     25        $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
    2526
    2627unpacker: unpacker.o $(LIBS)
    27         cc $(CFLAGS) -o $@ $@.o $(LIBS)
     28        $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
    2829
    2930testnum: testnum.o $(LIBS)
    30         cc $(CFLAGS) -o $@ $@.o $(LIBS)
     31        $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
    3132
    3233teststr: teststr.o $(LIBS)
    33         cc $(CFLAGS) -o $@ $@.o $(LIBS)
     34        $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
    3435
    3536testlib: testlib.o $(LIBS)
    36         cc $(CFLAGS) -o $@ $@.o $(LIBS)
     37        $(CC) $(CFLAGS) -o $@ $@.o $(LDFLAGS)
    3738
    3839clean:
    3940        -rm *.o *~ all
    4041        -rm teststr testnum testlib packer unpacker
     42
     43install: all create-cracklib-dict
     44        install -m 755 mkdict packer create-cracklib-dict $(DESTDIR)/usr/sbin
  • util/create-cracklib-dict

    diff -Naur cracklib,2.7-orig/util/create-cracklib-dict cracklib,2.7/util/create-cracklib-dict
    old new  
     1#!/bin/sh
     2if [ -z "$*" ]; then
     3    echo "Usage:"
     4    echo "  /usr/sbin/create-cracklib-dict wordlist ..."
     5    echo
     6    echo "This script takes one or more word list files as arguments"
     7    echo "and converts them into cracklib dictionaries for use"
     8    echo "by password checking programs. The results are placed in"
     9    echo "/lib/cracklib_dict.*"
     10    echo
     11    echo "Example:"
     12    echo "/usr/sbin/create-cracklib-dict /usr/dict/words"
     13else
     14    /usr/sbin/mkdict $* | /usr/sbin/packer /usr/share/cracklib/pw_dict
     15fi
Note: See TracBrowser for help on using the repository browser.