- include the dictionary filename suffix in error messages
This commit is contained in:
parent
cc74371eea
commit
c814b8b364
31
cracklib-2.8.10-suffix.patch
Normal file
31
cracklib-2.8.10-suffix.patch
Normal file
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user