summaryrefslogtreecommitdiff
path: root/extra/slim/ptr_pam.patch
blob: 3a3fbcdb7fe78b9387321e01f325fad3aae0dc4d (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
diff -aur old/app.cpp new/app.cpp
--- old/app.cpp	2010-07-08 07:04:10.000000000 +0200
+++ new/app.cpp	2011-05-01 18:30:52.933844872 +0200
@@ -43,8 +43,8 @@
     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;
+        (*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
@@ -53,13 +53,13 @@
                     case Panel::Suspend:
                     case Panel::Halt:
                     case Panel::Reboot:
-                        resp[i]->resp=strdup("root");
+                        (*resp)[i].resp=strdup("root");
                         break;
 
                     case Panel::Console:
                     case Panel::Exit:
                     case Panel::Login:
-                        resp[i]->resp=strdup(panel->GetName().c_str());
+                        (*resp)[i].resp=strdup(panel->GetName().c_str());
                         break;
                 }
                 break;
@@ -75,7 +75,7 @@
 
                     default:
                         panel->EventHandler(Panel::Get_Passwd);
-                        resp[i]->resp=strdup(panel->GetPasswd().c_str());
+                        (*resp)[i].resp=strdup(panel->GetPasswd().c_str());
                         break;
                 }
                 break;
@@ -91,9 +91,9 @@
     }
     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;
+            if ((*resp)[i].resp==0) continue;
+            free((*resp)[i].resp);
+            (*resp)[i].resp=0;
         };
         free(*resp);
         *resp=0;