52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
--- pam_python.c.orig 2020-11-13 00:23:03.000000000 +0300
|
|
+++ pam_python.c 2021-12-24 12:17:30.677867656 +0300
|
|
@@ -102,9 +102,10 @@
|
|
#define Py23_String_Check PyUnicode_Check
|
|
#define Py23_String_FromString PyUnicode_FromString
|
|
#define Py23_String_FromStringAndSize PyUnicode_FromStringAndSize
|
|
-#define Py23_String_GET_SIZE PyUnicode_GET_SIZE
|
|
+//#define Py23_String_GET_SIZE PyUnicode_GET_SIZE
|
|
+#define Py23_String_GET_SIZE PyUnicode_GetLength
|
|
#define Py23_String_Parse_Char "U"
|
|
-#define Py23_String_Size PyUnicode_Size
|
|
+#define Py23_String_Size PyBytes_Size
|
|
#define Py23_String_Type PyUnicode_Type
|
|
#define Py23_TYPE(p) Py_TYPE(p)
|
|
#endif
|
|
@@ -434,7 +435,7 @@
|
|
* Just print the exception in some recognisable form, hopefully.
|
|
*/
|
|
syslog_open(module_path);
|
|
- if (PyClass_Check(ptype))
|
|
+ if (PyType_Check(ptype))
|
|
stype = PyObject_GetAttrString(ptype, "__name__");
|
|
else
|
|
{
|
|
@@ -578,7 +579,7 @@
|
|
"OOOOO", ptype, pvalue, ptraceback, Py_None, pamHandle->syslogFile);
|
|
if (args != 0)
|
|
{
|
|
- py_resultobj = PyEval_CallObject(pamHandle->print_exception, args);
|
|
+ py_resultobj = PyObject_CallObject(pamHandle->print_exception, args);
|
|
if (py_resultobj != 0)
|
|
SyslogFile_flush(pamHandle->syslogFile);
|
|
}
|
|
@@ -876,7 +877,7 @@
|
|
value = 0;
|
|
else
|
|
{
|
|
- value = Py23_String_AsString(pyValue);
|
|
+ value = (char*) Py23_String_AsString(pyValue);
|
|
if (value == 0)
|
|
{
|
|
snprintf(
|
|
@@ -2802,7 +2803,7 @@
|
|
/*
|
|
* Call the Python handler function.
|
|
*/
|
|
- py_resultobj = PyEval_CallObject(handler_function, handler_args);
|
|
+ py_resultobj = PyObject_CallObject(handler_function, handler_args);
|
|
/*
|
|
* Did it throw an exception?
|
|
*/
|