From b64d92cc00a451494ad8b66e86747e72aef15a2c Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Jan 25 2007 17:33:12 +0000 Subject: - fix check for the existence of dictionaries when the caller specifies a location (#224347, upstream #1644628) --- diff --git a/cracklib-2.8.9-suffix.patch b/cracklib-2.8.9-suffix.patch new file mode 100644 index 0000000..0f299b7 --- /dev/null +++ b/cracklib-2.8.9-suffix.patch @@ -0,0 +1,45 @@ +--- cracklib-2.8.9/python/cracklibmodule.c 2007-01-25 12:16:30.000000000 -0500 ++++ cracklib-2.8.9/python/cracklibmodule.c 2007-01-25 12:16:32.000000000 -0500 +@@ -19,6 +19,8 @@ + #define UNLOCK() + #endif + ++#define DICT_SUFFIX ".pwd" ++ + static PyObject * + cracklib_FascistCheck(PyObject *self, PyObject *args, PyObject *kwargs) + { +@@ -27,6 +29,7 @@ + const char *result; + struct stat st; + char *keywords[] = {"pw", "dictpath", NULL}; ++ char *dictfile; + + self = NULL; + candidate = NULL; +@@ -52,14 +55,23 @@ + "second argument was not an absolute path!"); + return NULL; + } +- if (lstat(dict, &st) == -1) ++ dictfile = malloc(strlen(dict) + sizeof(DICT_SUFFIX)); ++ if (dictfile == NULL) ++ { ++ PyErr_SetFromErrnoWithFilename(PyExc_OSError, dict); ++ return NULL; ++ } ++ sprintf(dictfile, "%s" DICT_SUFFIX, dict); ++ if (lstat(dictfile, &st) == -1) + { + PyErr_SetFromErrnoWithFilename(PyExc_OSError, dict); ++ free(dictfile); + return NULL; + } ++ free(dictfile); + } else + { +- if (lstat(DEFAULT_CRACKLIB_DICT ".pwd", &st) == -1) ++ if (lstat(DEFAULT_CRACKLIB_DICT DICT_SUFFIX, &st) == -1) + { + PyErr_SetFromErrnoWithFilename(PyExc_OSError, + DEFAULT_CRACKLIB_DICT); diff --git a/cracklib.spec b/cracklib.spec index c4cfc70..61c32d6 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -4,7 +4,7 @@ Summary: A password-checking library. Name: cracklib Version: 2.8.9 -Release: 6 +Release: 7 Group: System Environment/Libraries Source0: http://prdownloads.sourceforge.net/cracklib/cracklib-%{version}.tar.gz Source1: http://prdownloads.sourceforge.net/cracklib/cracklib-words.gz @@ -36,6 +36,7 @@ Source33: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/names/names.french.gz Source34: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/names/names.hp.gz Source35: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/names/other-names.gz Source36: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/names/surnames.finnish.gz +Patch0: cracklib-2.8.9-suffix.patch URL: http://sourceforge.net/projects/cracklib/ License: Artistic Buildroot: %{_tmppath}/%{name}-%{version}-root @@ -93,6 +94,7 @@ If you are installing CrackLib, you should also install cracklib-dicts. %prep %setup -q +%patch0 -p1 -b .suffix autoreconf mkdir cracklib-dicts for dict in %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} \ @@ -172,6 +174,10 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la %{_libdir}/python*/site-packages/cracklibmodule.so %changelog +* Thu Jan 25 2007 Nalin Dahyabhai - 2.8.9-7 +- fix check for the existence of dictionaries when the caller specifies a + location (#224347, upstream #1644628) + * Thu Dec 7 2006 Jeremy Katz - 2.8.9-6 - rebuild against python 2.5