X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-login.c;h=03fea99ad4e8f79ceb3a426d073f75444817933e;hb=76f40bdb988440a73431eb14a27f30aeaa18ebe5;hp=8ac5471ad488bfd36eaf1067969263ff6aa5778f;hpb=6131822af6c0e2476dd539239d497dc0067271bc;p=ngircd-alex.git diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 8ac5471a..03fea99a 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -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); @@ -847,18 +850,16 @@ cb_Read_Auth_Result(int r_fd, UNUSED short events) if (len == 0) return; - /* Make sure authenticator sub-process is dead now ... */ - Proc_Kill(proc); - if (len != sizeof(result)) { Log(LOG_CRIT, "Auth: Got malformed result!"); Reject_Client(client); return; } - if (result == true) + if (result == true) { + Client_SetUser(client, Client_OrigUser(client), true); (void)Hello_User_PostAuth(client); - else + } else Reject_Client(client); }