1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
diff -up a/PAMmodule.c b/PAMmodule.c
--- a/PAMmodule.c
+++ b/PAMmodule.c
@@ -248,7 +248,7 @@ static PyObject * PyPAM_setcred(PyObject
result = pam_setcred(_self->pamh, flags);
if (result != PAM_SUCCESS) {
- PyErr_SetString(PyPAM_Error, "Not authenticated");
+ PyPAM_Err(_self, result);
return NULL;
}
@@ -270,7 +270,7 @@ static PyObject * PyPAM_acct_mgmt(PyObje
result = pam_acct_mgmt(_self->pamh, flags);
if (result != PAM_SUCCESS) {
- PyErr_SetString(PyPAM_Error, "Not authenticated");
+ PyPAM_Err(_self, result);
return NULL;
}
@@ -292,7 +292,7 @@ static PyObject * PyPAM_chauthtok(PyObje
result = pam_chauthtok(_self->pamh, flags);
if (result != PAM_SUCCESS) {
- PyErr_SetString(PyPAM_Error, "Not authenticated");
+ PyPAM_Err(_self, result);
return NULL;
}
@@ -314,7 +314,7 @@ static PyObject * PyPAM_open_session(PyO
result = pam_open_session(_self->pamh, flags);
if (result != PAM_SUCCESS) {
- PyErr_SetString(PyPAM_Error, "Not authenticated");
+ PyPAM_Err(_self, result);
return NULL;
}
@@ -336,7 +336,7 @@ static PyObject * PyPAM_close_session(Py
result = pam_close_session(_self->pamh, flags);
if (result != PAM_SUCCESS) {
- PyErr_SetString(PyPAM_Error, "Not authenticated");
+ PyPAM_Err(_self, result);
return NULL;
}
@@ -433,7 +433,7 @@ static PyObject * PyPAM_putenv(PyObject
result = pam_putenv(_self->pamh, val);
if (result != PAM_SUCCESS) {
- PyErr_SetString(PyPAM_Error, "Not authenticated");
+ PyPAM_Err(_self, result);
return NULL;
}
|