From fbf890aaa11d97a3eb39a8bef07d91d311430dcf Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Oct 28 2008 18:00:40 +0000 Subject: update to 2.8.13, which mainly overhauls the python bindings --- diff --git a/.cvsignore b/.cvsignore index 4b49299..087ee19 100644 --- a/.cvsignore +++ b/.cvsignore @@ -37,3 +37,4 @@ cracklib-2.8.9.tar.gz pass_file.gz cracklib-2.8.10.tar.gz cracklib-2.8.12.tar.gz +cracklib-2.8.13.tar.gz diff --git a/cracklib-2.8.10-docstring.patch b/cracklib-2.8.10-docstring.patch deleted file mode 100644 index 3ba871c..0000000 --- a/cracklib-2.8.10-docstring.patch +++ /dev/null @@ -1,39 +0,0 @@ -Some docstrings for the Python module. Need to figure out how to fix the -summary in the help() output. - python -c 'import cracklib; help(cracklib)' - -diff -up cracklib-2.8.10/python/cracklibmodule.c cracklib-2.8.10/python/cracklibmodule.c ---- cracklib-2.8.10/python/cracklibmodule.c 2007-07-19 09:57:04.000000000 -0400 -+++ cracklib-2.8.10/python/cracklibmodule.c 2007-07-19 09:57:48.000000000 -0400 -@@ -24,7 +24,6 @@ static pthread_mutex_t cracklib_mutex = - static PyObject * - cracklib_FascistCheck(PyObject *self, PyObject *args, PyObject *kwargs) - { -- int i; - char *candidate, *dict; - const char *result; - struct stat st; -@@ -96,12 +95,21 @@ cracklib_FascistCheck(PyObject *self, Py - static PyMethodDef - cracklibmethods[] = - { -- {"FascistCheck", cracklib_FascistCheck, METH_VARARGS | METH_KEYWORDS}, -+ {"FascistCheck", cracklib_FascistCheck, METH_VARARGS | METH_KEYWORDS, -+ "Keyword arguments:\n" -+ " pw - candidate password\n" -+ " dict - dictionary location (default \"" -+ DEFAULT_CRACKLIB_DICT -+ "\")\n" -+ "\n" -+ "Returns:\n" -+ " None on success, an error string on failure.\n"}, - {NULL, NULL}, - }; - - void - initcracklib(void) - { -- Py_InitModule("cracklib", cracklibmethods); -+ Py_InitModule3("cracklib", cracklibmethods, -+ "Python interface to libcrack's FascistCheck() function.\n"); - } diff --git a/cracklib-2.8.10-suffix.patch b/cracklib-2.8.10-suffix.patch deleted file mode 100644 index 150fdb4..0000000 --- a/cracklib-2.8.10-suffix.patch +++ /dev/null @@ -1,32 +0,0 @@ -Tiny problems in errors reported: when we're out of memory, report out of -memory unrelated to the filename. When we notice that the dictionary isn't -there, give the name of the file which wasn't there. - python -c 'import cracklib;cracklib.FascistCheck("canihas","/tmp/notthere")' -diff -up cracklib-2.8.10/python/cracklibmodule.c cracklib-2.8.10/python/cracklibmodule.c ---- cracklib-2.8.10/python/cracklibmodule.c 2007-01-26 11:55:07.000000000 -0500 -+++ cracklib-2.8.10/python/cracklibmodule.c 2007-07-19 09:55:22.000000000 -0400 -@@ -58,13 +58,13 @@ cracklib_FascistCheck(PyObject *self, Py - dictfile = malloc(strlen(dict) + sizeof(DICT_SUFFIX)); - if (dictfile == NULL) - { -- PyErr_SetFromErrnoWithFilename(PyExc_OSError, dict); -+ PyErr_SetFromErrno(PyExc_MemoryError); - return NULL; - } - sprintf(dictfile, "%s" DICT_SUFFIX, dict); - if (lstat(dictfile, &st) == -1) - { -- PyErr_SetFromErrnoWithFilename(PyExc_OSError, dict); -+ PyErr_SetFromErrnoWithFilename(PyExc_OSError, dictfile); - free(dictfile); - return NULL; - } -@@ -74,7 +74,7 @@ cracklib_FascistCheck(PyObject *self, Py - if (lstat(DEFAULT_CRACKLIB_DICT DICT_SUFFIX, &st) == -1) - { - PyErr_SetFromErrnoWithFilename(PyExc_OSError, -- DEFAULT_CRACKLIB_DICT); -+ DEFAULT_CRACKLIB_DICT DICT_SUFFIX); - return NULL; - } - } diff --git a/cracklib-2.8.12-inttypes.patch b/cracklib-2.8.12-inttypes.patch deleted file mode 100644 index 8a5b82c..0000000 --- a/cracklib-2.8.12-inttypes.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- cracklib-2.8.9/configure.in 2006-02-17 14:49:12.000000000 -0500 -+++ cracklib-2.8.9/configure.in 2007-03-12 18:47:32.000000000 -0400 -@@ -23,6 +23,19 @@ - AC_CHECK_HEADERS(stdint.h) - AC_CHECK_HEADERS(pthread.h) - -+if test x$ac_cv_header_inttypes_h = xyes ; then -+ CRACKLIB_INTEGER_TYPES1="#include " -+ CRACKLIB_INTEGER_TYPES2= -+elif test x$ac_cv_header_stdint_h = xyes ; then -+ CRACKLIB_INTEGER_TYPES1="#include " -+ CRACKLIB_INTEGER_TYPES2= -+else -+ CRACKLIB_INTEGER_TYPES1="typedef unsigned int uint32_t;" -+ CRACKLIB_INTEGER_TYPES2="typedef unsigned short uint16_t;" -+fi -+AC_SUBST(CRACKLIB_INTEGER_TYPES1) -+AC_SUBST(CRACKLIB_INTEGER_TYPES2) -+ - dnl Cygwin workaround - AC_MSG_CHECKING(if LINE_MAX is defined) - AC_EGREP_CPP(yes, -@@ -87,6 +100,8 @@ - dnl Handle local dict compiling properly - AC_SUBST(CROSS_COMPILING, $cross_compiling) - --AC_OUTPUT(util/Makefile lib/Makefile doc/Makefile python/Makefile Makefile \ -- po/Makefile.in m4/Makefile dicts/Makefile cracklib.spec) -+AC_CONFIG_FILES(util/Makefile lib/Makefile doc/Makefile python/Makefile \ -+ Makefile po/Makefile.in m4/Makefile dicts/Makefile \ -+ cracklib.spec lib/packer.h) -+AC_OUTPUT - ---- cracklib-2.8.9/lib/packer.h.in 2007-03-12 18:47:32.000000000 -0400 -+++ cracklib-2.8.9/lib/packer.h.in 2007-03-12 18:49:50.000000000 -0400 -@@ -32,17 +32,8 @@ - #define _(String) (String) - #endif - --#if defined(HAVE_INTTYPES_H) --#include --#else --#if defined(HAVE_STDINT_H) --#include --#else --typedef unsigned int uint32_t; --typedef unsigned short uint16_t; --#endif --#endif -- -+@CRACKLIB_INTEGER_TYPES1@ -+@CRACKLIB_INTEGER_TYPES2@ - - struct pi_header - { -@@ -84,6 +75,9 @@ - int dummy; - } PWDICT; - -+@CRACKLIB_INTEGER_TYPES1@ -+@CRACKLIB_INTEGER_TYPES2@ -+ - #endif - - extern PWDICT *PWOpen(const char *prefix, char *mode); diff --git a/cracklib-2.8.13-inttypes.patch b/cracklib-2.8.13-inttypes.patch new file mode 100644 index 0000000..1709817 --- /dev/null +++ b/cracklib-2.8.13-inttypes.patch @@ -0,0 +1,71 @@ +Don't depend on a consumer of to be using autoconf, and to be +checking for for the presence of and , and including +its own "config.h" before including , in order for this to be +correct on 64-bit machines. +diff -up cracklib-2.8.13/configure.in cracklib-2.8.13/configure.in +--- cracklib-2.8.13/configure.in 2008-09-23 07:53:24.000000000 -0400 ++++ cracklib-2.8.13/configure.in 2008-10-28 13:39:08.000000000 -0400 +@@ -26,6 +26,19 @@ AC_CHECK_HEADERS(zlib.h, AC_DEFINE(HAVE_ + + AC_SEARCH_LIBS(gzopen, z) + ++if test x$ac_cv_header_inttypes_h = xyes ; then ++ CRACKLIB_INTEGER_TYPES1="#include " ++ CRACKLIB_INTEGER_TYPES2= ++elif test x$ac_cv_header_stdint_h = xyes ; then ++ CRACKLIB_INTEGER_TYPES1="#include " ++ CRACKLIB_INTEGER_TYPES2= ++else ++ CRACKLIB_INTEGER_TYPES1="typedef unsigned int uint32_t;" ++ CRACKLIB_INTEGER_TYPES2="typedef unsigned short uint16_t;" ++fi ++AC_SUBST(CRACKLIB_INTEGER_TYPES1) ++AC_SUBST(CRACKLIB_INTEGER_TYPES2) ++ + dnl Cygwin workaround + AC_MSG_CHECKING(if LINE_MAX is defined) + AC_EGREP_CPP(yes, +@@ -90,6 +103,8 @@ AM_CONDITIONAL(BUILD_PYTHON,[test "$buil + dnl Handle local dict compiling properly + AC_SUBST(CROSS_COMPILING, $cross_compiling) + +-AC_OUTPUT(util/Makefile lib/Makefile doc/Makefile python/Makefile Makefile \ +- po/Makefile.in m4/Makefile dicts/Makefile cracklib.spec) ++AC_CONFIG_FILES(util/Makefile lib/Makefile doc/Makefile python/Makefile \ ++ Makefile po/Makefile.in m4/Makefile dicts/Makefile \ ++ cracklib.spec lib/packer.h) ++AC_OUTPUT + +diff -up cracklib-2.8.13/lib/packer.h.in cracklib-2.8.13/lib/packer.h.in +--- cracklib-2.8.13/lib/packer.h.in 2008-10-28 13:38:25.000000000 -0400 ++++ cracklib-2.8.13/lib/packer.h.in 2008-10-28 13:38:25.000000000 -0400 +@@ -30,17 +30,8 @@ + #define _(String) (String) + #endif + +-#if defined(HAVE_INTTYPES_H) +-#include +-#else +-#if defined(HAVE_STDINT_H) +-#include +-#else +-typedef unsigned int uint32_t; +-typedef unsigned short uint16_t; +-#endif +-#endif +- ++@CRACKLIB_INTEGER_TYPES1@ ++@CRACKLIB_INTEGER_TYPES2@ + + struct pi_header + { +@@ -83,6 +74,9 @@ typedef struct { + int dummy; + } PWDICT; + ++@CRACKLIB_INTEGER_TYPES1@ ++@CRACKLIB_INTEGER_TYPES2@ ++ + #endif + + extern PWDICT *PWOpen(const char *prefix, char *mode); diff --git a/cracklib-2.8.13-suffix.patch b/cracklib-2.8.13-suffix.patch new file mode 100644 index 0000000..26f3e59 --- /dev/null +++ b/cracklib-2.8.13-suffix.patch @@ -0,0 +1,22 @@ +Don't drop the file's extension when naming the file that we couldn't access. +diff -up cracklib-2.8.13/python/_cracklibmodule.c cracklib-2.8.13/python/_cracklibmodule.c +--- cracklib-2.8.13/python/_cracklibmodule.c 2008-10-28 13:17:48.000000000 -0400 ++++ cracklib-2.8.13/python/_cracklibmodule.c 2008-10-28 13:17:54.000000000 -0400 +@@ -100,7 +100,7 @@ _cracklib_FascistCheck(PyObject *self, P + sprintf(dictfile, "%s" DICT_SUFFIX, dict); + if (lstat(dictfile, &st) == -1) + { +- PyErr_SetFromErrnoWithFilename(PyExc_OSError, dict); ++ PyErr_SetFromErrnoWithFilename(PyExc_OSError, dictfile); + free(dictfile); + return NULL; + } +@@ -110,7 +110,7 @@ _cracklib_FascistCheck(PyObject *self, P + if (lstat(DEFAULT_CRACKLIB_DICT DICT_SUFFIX, &st) == -1) + { + PyErr_SetFromErrnoWithFilename(PyExc_OSError, +- DEFAULT_CRACKLIB_DICT); ++ DEFAULT_CRACKLIB_DICT DICT_SUFFIX); + return NULL; + } + } diff --git a/cracklib.spec b/cracklib.spec index 5bbaa9e..41bdb21 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -4,8 +4,8 @@ Summary: A password-checking library Name: cracklib -Version: 2.8.12 -Release: 3 +Version: 2.8.13 +Release: 1 Group: System Environment/Libraries Source0: http://prdownloads.sourceforge.net/cracklib/cracklib-%{version}.tar.gz @@ -43,10 +43,9 @@ Source36: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/names/surnames.finnish. # No upstream source for this; it came in as a bugzilla attachment. Source37: pass_file.gz -Patch0: cracklib-2.8.10-suffix.patch -Patch1: cracklib-2.8.12-inttypes.patch -Patch2: cracklib-2.8.10-docstring.patch -Patch3: cracklib-2.8.12-gettext.patch +Patch0: cracklib-2.8.13-suffix.patch +Patch1: cracklib-2.8.13-inttypes.patch +Patch2: cracklib-2.8.12-gettext.patch URL: http://sourceforge.net/projects/cracklib/ License: GPLv2 Buildroot: %{_tmppath}/%{name}-%{version}-root @@ -108,8 +107,7 @@ If you are installing CrackLib, you should also install cracklib-dicts. %patch0 -p1 -b .suffix cp lib/packer.h lib/packer.h.in %patch1 -p1 -b .inttypes -%patch2 -p1 -b .docstring -%patch3 -p1 -b .gettext +%patch2 -p1 -b .gettext autoreconf -f -i mkdir cracklib-dicts for dict in %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} \ @@ -215,6 +213,9 @@ EOF %{_libdir}/python*/site-packages/cracklibmodule.so %changelog +* Tue Oct 28 2008 Nalin Dahyabhai - 2.8.13-1 +- update to 2.8.13, which mainly overhauls the python bindings + * Tue Oct 28 2008 Nalin Dahyabhai - 2.8.12-3 - fix errors rebuilding with libtool that's newer than the one upstream has (#467364) diff --git a/sources b/sources index 7db85d3..fab82e2 100644 --- a/sources +++ b/sources @@ -27,4 +27,4 @@ a2bd31ce25a3057b61d2e5a1182d93a9 sf.gz c03b38448aefcde059e6fcfb20784f2c surnames.finnish.gz 6e76a087a646ede5eba05e9259fd84d4 pass_file.gz d18e670e5df560a8745e1b4dede8f84f cracklib-words.gz -580346fa1012f9d9769192f49d3801fa cracklib-2.8.12.tar.gz +5beb4c6b3c31c83fc98c4c225b25cd94 cracklib-2.8.13.tar.gz