- update to 2.8.10

This commit is contained in:
Nalin Dahyabhai 2007-07-19 14:06:35 +00:00
parent c4b52ac992
commit 5e736e6ca6
7 changed files with 11 additions and 91 deletions

View File

@ -35,3 +35,4 @@ cracklib-2.8.5.tar.gz
cracklib-2.8.6.tar.gz
cracklib-2.8.9.tar.gz
pass_file.gz
cracklib-2.8.10.tar.gz

View File

@ -1,5 +1,6 @@
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

View File

@ -1,6 +1,7 @@
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

View File

@ -1,38 +0,0 @@
Some docstrings for the Python module. Need to figure out how to fix the
summary in the help() output.
diff -ur cracklib-2.8.9/python/cracklibmodule.c cracklib-2.8.9/python/cracklibmodule.c
--- cracklib-2.8.9/python/cracklibmodule.c 2007-01-29 17:28:41.000000000 -0500
+++ cracklib-2.8.9/python/cracklibmodule.c 2007-01-29 17:20:14.000000000 -0500
@@ -24,7 +24,6 @@
static PyObject *
cracklib_FascistCheck(PyObject *self, PyObject *args, PyObject *kwargs)
{
- int i;
char *candidate, *dict, *dictfile;
const char *result;
struct stat st;
@@ -96,12 +95,21 @@
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");
}

View File

@ -1,48 +0,0 @@
--- cracklib-2.8.9/python/cracklibmodule.c.suffix 2005-09-26 16:42:34.000000000 -0400
+++ cracklib-2.8.9/python/cracklibmodule.c 2007-06-20 14:16:52.000000000 -0400
@@ -19,11 +19,13 @@ static pthread_mutex_t cracklib_mutex =
#define UNLOCK()
#endif
+#define DICT_SUFFIX ".pwd"
+
static PyObject *
cracklib_FascistCheck(PyObject *self, PyObject *args, PyObject *kwargs)
{
int i;
- char *candidate, *dict;
+ char *candidate, *dict, *dictfile;
const char *result;
struct stat st;
char *keywords[] = {"pw", "dictpath", NULL};
@@ -52,17 +54,26 @@ cracklib_FascistCheck(PyObject *self, Py
"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_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;
}
+ 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);
+ DEFAULT_CRACKLIB_DICT DICT_SUFFIX);
return NULL;
}
}

View File

@ -3,8 +3,8 @@
Summary: A password-checking library
Name: cracklib
Version: 2.8.9
Release: 11
Version: 2.8.10
Release: 1
Group: System Environment/Libraries
Source0: http://prdownloads.sourceforge.net/cracklib/cracklib-%{version}.tar.gz
@ -42,9 +42,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.9-suffix.patch
Patch0: cracklib-2.8.10-suffix.patch
Patch1: cracklib-2.8.9-inttypes.patch
Patch2: cracklib-2.8.9-docstring.patch
Patch2: cracklib-2.8.10-docstring.patch
URL: http://sourceforge.net/projects/cracklib/
License: Artistic
Buildroot: %{_tmppath}/%{name}-%{version}-root
@ -184,6 +184,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la
%{_libdir}/python*/site-packages/cracklibmodule.so
%changelog
* Thu Jul 19 2007 Nalin Dahyabhai <nalin@redhat.com> - 2.8.10-1
- update to 2.8.10
* Wed Jun 20 2007 Nalin Dahyabhai <nalin@redhat.com> - 2.8.9-11
- improve reports of out-of-memory exceptions so that they don't include a
bogus filename

View File

@ -25,6 +25,6 @@ f70810a2ba08f95df6787afe0eba2907 other-names.gz
a2bd31ce25a3057b61d2e5a1182d93a9 sf.gz
15ec61296de799eaa8111cfabbcbb44f shakespeare.gz
c03b38448aefcde059e6fcfb20784f2c surnames.finnish.gz
9a8c9eb26b48787c84024ac779f64bb2 cracklib-2.8.9.tar.gz
6e76a087a646ede5eba05e9259fd84d4 pass_file.gz
d18e670e5df560a8745e1b4dede8f84f cracklib-words.gz
555f7832b63ebc7fb70b0373500c2358 cracklib-2.8.10.tar.gz