From c814b8b364a72072798276a86fc353d79eca4f8a Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Jul 19 2007 14:04:02 +0000 Subject: - include the dictionary filename suffix in error messages --- diff --git a/cracklib-2.8.10-suffix.patch b/cracklib-2.8.10-suffix.patch new file mode 100644 index 0000000..c012e38 --- /dev/null +++ b/cracklib-2.8.10-suffix.patch @@ -0,0 +1,31 @@ +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. +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; + } + }