blob: 2163d20a5e324cd6ce2ec05689abac9af82dff09 (
plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
diff -rc slim-1.3.1-orig/app.cpp slim-1.3.1/app.cpp
*** slim-1.3.1-orig/app.cpp 2008-09-26 02:54:15.000000000 +0200
--- slim-1.3.1/app.cpp 2009-02-17 19:50:06.000000000 +0100
***************
*** 41,48 ****
Panel* panel = *static_cast<Panel**>(appdata_ptr);
int result = PAM_SUCCESS;
for (int i=0; i<num_msg; i++){
! resp[i]->resp=0;
! resp[i]->resp_retcode=0;
switch(msg[i]->msg_style){
case PAM_PROMPT_ECHO_ON:
// We assume PAM is asking for the username
--- 41,48 ----
Panel* panel = *static_cast<Panel**>(appdata_ptr);
int result = PAM_SUCCESS;
for (int i=0; i<num_msg; i++){
! (*resp)[i].resp=0;
! (*resp)[i].resp_retcode=0;
switch(msg[i]->msg_style){
case PAM_PROMPT_ECHO_ON:
// We assume PAM is asking for the username
***************
*** 51,63 ****
case Panel::Suspend:
case Panel::Halt:
case Panel::Reboot:
! resp[i]->resp=strdup("root");
break;
case Panel::Console:
case Panel::Exit:
case Panel::Login:
! resp[i]->resp=strdup(panel->GetName().c_str());
break;
}
break;
--- 51,63 ----
case Panel::Suspend:
case Panel::Halt:
case Panel::Reboot:
! (*resp)[i].resp=strdup("root");
break;
case Panel::Console:
case Panel::Exit:
case Panel::Login:
! (*resp)[i].resp=strdup(panel->GetName().c_str());
break;
}
break;
***************
*** 73,79 ****
default:
panel->EventHandler(Panel::Get_Passwd);
! resp[i]->resp=strdup(panel->GetPasswd().c_str());
break;
}
break;
--- 73,79 ----
default:
panel->EventHandler(Panel::Get_Passwd);
! (*resp)[i].resp=strdup(panel->GetPasswd().c_str());
break;
}
break;
***************
*** 89,97 ****
}
if (result!=PAM_SUCCESS){
for (int i=0; i<num_msg; i++){
! if (resp[i]->resp==0) continue;
! free(resp[i]->resp);
! resp[i]->resp=0;
};
free(*resp);
*resp=0;
--- 89,97 ----
}
if (result!=PAM_SUCCESS){
for (int i=0; i<num_msg; i++){
! if ((*resp)[i].resp==0) continue;
! free((*resp)[i].resp);
! (*resp)[i].resp=0;
};
free(*resp);
*resp=0;
|