|
|
fbd8a4 |
diff -up PyPAM-0.5.0/PAMmodule.c.retval PyPAM-0.5.0/PAMmodule.c
|
|
|
fbd8a4 |
--- PyPAM-0.5.0/PAMmodule.c.retval 2012-05-04 21:47:51.000000000 +0200
|
|
|
fbd8a4 |
+++ PyPAM-0.5.0/PAMmodule.c 2012-05-07 09:42:27.690963206 +0200
|
|
|
fbd8a4 |
@@ -248,7 +248,7 @@ static PyObject * PyPAM_setcred(PyObject
|
|
|
fbd8a4 |
result = pam_setcred(_self->pamh, flags);
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
if (result != PAM_SUCCESS) {
|
|
|
fbd8a4 |
- PyErr_SetString(PyPAM_Error, "Not authenticated");
|
|
|
fbd8a4 |
+ PyPAM_Err(_self, result);
|
|
|
fbd8a4 |
return NULL;
|
|
|
fbd8a4 |
}
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
@@ -270,7 +270,7 @@ static PyObject * PyPAM_acct_mgmt(PyObje
|
|
|
fbd8a4 |
result = pam_acct_mgmt(_self->pamh, flags);
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
if (result != PAM_SUCCESS) {
|
|
|
fbd8a4 |
- PyErr_SetString(PyPAM_Error, "Not authenticated");
|
|
|
fbd8a4 |
+ PyPAM_Err(_self, result);
|
|
|
fbd8a4 |
return NULL;
|
|
|
fbd8a4 |
}
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
@@ -292,7 +292,7 @@ static PyObject * PyPAM_chauthtok(PyObje
|
|
|
fbd8a4 |
result = pam_chauthtok(_self->pamh, flags);
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
if (result != PAM_SUCCESS) {
|
|
|
fbd8a4 |
- PyErr_SetString(PyPAM_Error, "Not authenticated");
|
|
|
fbd8a4 |
+ PyPAM_Err(_self, result);
|
|
|
fbd8a4 |
return NULL;
|
|
|
fbd8a4 |
}
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
@@ -314,7 +314,7 @@ static PyObject * PyPAM_open_session(PyO
|
|
|
fbd8a4 |
result = pam_open_session(_self->pamh, flags);
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
if (result != PAM_SUCCESS) {
|
|
|
fbd8a4 |
- PyErr_SetString(PyPAM_Error, "Not authenticated");
|
|
|
fbd8a4 |
+ PyPAM_Err(_self, result);
|
|
|
fbd8a4 |
return NULL;
|
|
|
fbd8a4 |
}
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
@@ -336,7 +336,7 @@ static PyObject * PyPAM_close_session(Py
|
|
|
fbd8a4 |
result = pam_close_session(_self->pamh, flags);
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
if (result != PAM_SUCCESS) {
|
|
|
fbd8a4 |
- PyErr_SetString(PyPAM_Error, "Not authenticated");
|
|
|
fbd8a4 |
+ PyPAM_Err(_self, result);
|
|
|
fbd8a4 |
return NULL;
|
|
|
fbd8a4 |
}
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
@@ -433,7 +433,7 @@ static PyObject * PyPAM_putenv(PyObject
|
|
|
fbd8a4 |
result = pam_putenv(_self->pamh, val);
|
|
|
fbd8a4 |
|
|
|
fbd8a4 |
if (result != PAM_SUCCESS) {
|
|
|
fbd8a4 |
- PyErr_SetString(PyPAM_Error, "Not authenticated");
|
|
|
fbd8a4 |
+ PyPAM_Err(_self, result);
|
|
|
fbd8a4 |
return NULL;
|
|
|
fbd8a4 |
}
|
|
|
fbd8a4 |
|