diff --git a/PAMmodule.c b/PAMmodule.c index 65a2797..bd9b2e4 100644 --- a/PAMmodule.c +++ b/PAMmodule.c @@ -179,7 +179,9 @@ static PyObject * PyPAM_authenticate(PyObject *self, PyObject *args) return NULL; } + Py_BEGIN_ALLOW_THREADS result = pam_authenticate(_self->pamh, flags); + Py_END_ALLOW_THREADS if (result != PAM_SUCCESS) { PyPAM_Err(_self, result); @@ -223,7 +225,9 @@ static PyObject * PyPAM_acct_mgmt(PyObject *self, PyObject *args) return NULL; } + Py_BEGIN_ALLOW_THREADS result = pam_acct_mgmt(_self->pamh, flags); + Py_END_ALLOW_THREADS if (result != PAM_SUCCESS) { PyPAM_Err(_self, result); @@ -308,6 +312,7 @@ static PyObject * PyPAM_set_item(PyObject *self, PyObject *args) PyObject *o_val; PyPAMObject *_self = (PyPAMObject *) self; + Py_BEGIN_ALLOW_THREADS if (PyArg_ParseTuple(args, "is", &item, &s_val)) { n_val = strdup(s_val); if (item == PAM_USER) _self->user = n_val; @@ -332,6 +337,7 @@ static PyObject * PyPAM_set_item(PyObject *self, PyObject *args) return NULL; } } + Py_END_ALLOW_THREADS if (result != PAM_SUCCESS) { PyPAM_Err(_self, result);