]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-login.c
Don't reset My_Connections[Idx].lastping when reading data
[ngircd-alex.git] / src / ngircd / irc-login.c
index 93ee07e82a0100b125f359110e35e285e0a83ab3..03fea99ad4e8f79ceb3a426d073f75444817933e 100644 (file)
@@ -789,7 +789,10 @@ Hello_User(CLIENT * Client)
                return DISCONNECTED;
        }
 
-       pid = Proc_Fork(Conn_GetProcStat(conn), pipefd, cb_Read_Auth_Result);
+       /* Fork child process for PAM authentication; and make sure that the
+        * process timeout is set higher than the login timeout! */
+       pid = Proc_Fork(Conn_GetProcStat(conn), pipefd,
+                       cb_Read_Auth_Result, Conf_PongTimeout + 1);
        if (pid > 0) {
                LogDebug("Authenticator for connection %d created (PID %d).",
                         conn, pid);
@@ -853,9 +856,10 @@ cb_Read_Auth_Result(int r_fd, UNUSED short events)
                return;
        }
 
-       if (result == true)
+       if (result == true) {
+               Client_SetUser(client, Client_OrigUser(client), true);
                (void)Hello_User_PostAuth(client);
-       else
+       else
                Reject_Client(client);
 }