Blame SOURCES/PyPAM-0.5.0-return-value.patch

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