aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_cracklib
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-08-16 12:27:38 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-08-16 12:27:38 +0000
commit23624ea6f78ec8acc167a2491c00998907fc76b1 (patch)
treea57b3caee23a167d442d7d4e0419c4689dfba565 /modules/pam_cracklib
parent2b5457bbf7352200f7bc77795adbbcfd47550855 (diff)
downloadpam-23624ea6f78ec8acc167a2491c00998907fc76b1.tar.gz
pam-23624ea6f78ec8acc167a2491c00998907fc76b1.tar.bz2
pam-23624ea6f78ec8acc167a2491c00998907fc76b1.zip
Relevant BUGIDs: none
Purpose of commit: new feature Commit summary: --------------- Big "automake/autoconf/libtool" commit
Diffstat (limited to 'modules/pam_cracklib')
-rw-r--r--modules/pam_cracklib/Makefile32
-rw-r--r--modules/pam_cracklib/Makefile.am22
-rw-r--r--modules/pam_cracklib/pam_cracklib.c16
3 files changed, 30 insertions, 40 deletions
diff --git a/modules/pam_cracklib/Makefile b/modules/pam_cracklib/Makefile
deleted file mode 100644
index 5f6371ef..00000000
--- a/modules/pam_cracklib/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id$
-#
-# This Makefile controls a build process of $(TITLE) module for
-# Linux-PAM. You should not modify this Makefile (unless you know
-# what you are doing!).
-#
-# Created by Andrew Morgan <morgan@kernel.org> 2000/10/08
-#
-
-include ../../Make.Rules
-
-TITLE=pam_cracklib
-
-ifeq ($(HAVE_LIBCRACK),yes)
-BUILD_THIS_MODULE=yes
-MODULE_SIMPLE_EXTRALIBS=-lcrack
-
-# These two should really be provided by ../../pam_aconf.h
-CFLAGS+=-DCRACKLIB_DICTPATH=\"$(CRACKLIB_DICTPATH)\"
-
-ifeq ($(HAVE_LIBCRYPT),yes)
- MODULE_SIMPLE_EXTRALIBS += -lcrypt
-endif
-
-endif
-
-ifeq ($(BUILD_THIS_MODULE),yes)
- include ../Simple.Rules
-else
- include ../dont_makefile
-endif
diff --git a/modules/pam_cracklib/Makefile.am b/modules/pam_cracklib/Makefile.am
new file mode 100644
index 00000000..1ba84053
--- /dev/null
+++ b/modules/pam_cracklib/Makefile.am
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2005 Thorsten Kukuk <kukuk@suse.de>
+#
+
+CLEANFILES = *~
+
+EXTRA_DIST = README
+
+securelibdir = $(SECUREDIR)
+secureconfdir = $(SCONFIGDIR)
+
+AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
+ -I$(top_srcdir)/modules/pammodutil/include/
+AM_LDFLAGS = -avoid-version -module \
+ -L$(top_builddir)/modules/pammodutil -lpammodutil \
+ -L$(top_builddir)/libpam -lpam
+
+if HAVE_LIBCRACK
+securelib_LTLIBRARIES = pam_cracklib.la
+endif
+
+pam_cracklib_la_LIBADD = @LIBCRACK@ @LIBCRYPT@
diff --git a/modules/pam_cracklib/pam_cracklib.c b/modules/pam_cracklib/pam_cracklib.c
index e260b0a8..5f9d54bf 100644
--- a/modules/pam_cracklib/pam_cracklib.c
+++ b/modules/pam_cracklib/pam_cracklib.c
@@ -238,7 +238,7 @@ static char *_pam_delete(register char *xx)
/*
* can't be a palindrome - like `R A D A R' or `M A D A M'
*/
-static int palindrome(const char *old, const char *new)
+static int palindrome(const char *new)
{
int i, j;
@@ -257,7 +257,8 @@ static int palindrome(const char *old, const char *new)
* the other
*/
-static int distdifferent(const char *old, const char *new, int i, int j)
+static int distdifferent(const char *old, const char *new,
+ size_t i, size_t j)
{
char c, d;
@@ -275,7 +276,7 @@ static int distdifferent(const char *old, const char *new, int i, int j)
}
static int distcalculate(int **distances, const char *old, const char *new,
- int i, int j)
+ size_t i, size_t j)
{
int tmp = 0;
@@ -296,7 +297,7 @@ static int distcalculate(int **distances, const char *old, const char *new,
static int distance(const char *old, const char *new)
{
int **distances = NULL;
- int m, n, i, j, r;
+ size_t m, n, i, j, r;
m = strlen(old);
n = strlen(new);
@@ -345,8 +346,7 @@ static int similar(struct cracklib_options *opt,
/*
* a nice mix of characters.
*/
-static int simple(struct cracklib_options *opt,
- const char *old, const char *new)
+static int simple(struct cracklib_options *opt, const char *new)
{
int digits = 0;
int uppers = 0;
@@ -439,7 +439,7 @@ static const char * password_check(struct cracklib_options *opt, const char *old
strcpy (wrapped, oldmono);
strcat (wrapped, oldmono);
- if (palindrome(oldmono, newmono))
+ if (palindrome(newmono))
msg = "is a palindrome";
if (!msg && strcmp(oldmono, newmono) == 0)
@@ -448,7 +448,7 @@ static const char * password_check(struct cracklib_options *opt, const char *old
if (!msg && similar(opt, oldmono, newmono))
msg = "is too similar to the old one";
- if (!msg && simple(opt, old, new))
+ if (!msg && simple(opt, new))
msg = "is too simple";
if (!msg && strstr(wrapped, newmono))