Browse Source

Fix PAM authentication fails with pam_unix2 (Closes: #15287)

Thanks for eworm.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@217 7c53e7cc-98ea-0310-8f1f-a0b24da60408
iwamatsu 9 years ago
parent
commit
02d20f055b
1 changed files with 8 additions and 8 deletions
  1. 8 8
      app.cpp

+ 8 - 8
app.cpp

@@ -43,8 +43,8 @@ int conv(int num_msg, const struct pam_message **msg,
     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 @@ int conv(int num_msg, const struct pam_message **msg,
                     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 @@ int conv(int num_msg, const struct pam_message **msg,
 
                     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 @@ int conv(int num_msg, const struct pam_message **msg,
     }
     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;