Fix new auth system timeout bugs (SF bug#1469462).
authorMichael Poole <mdpoole@troilus.org>
Sat, 29 Apr 2006 02:34:03 +0000 (02:34 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 29 Apr 2006 02:34:03 +0000 (02:34 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1645 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_auth.c

index fd6237cd7bfc506525ad136ceccd4af46b62b5d8..02ff6c2c495a4b73cf649c4e14e9b0552616a3e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-28  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/s_auth.c (AuthRequest): Clarify comment on 'timeout' field.
+       (check_auth_finished): Fix timeout update.
+       (destroy_auth_request): Only delete timer if it is active.
+       (auth_timeout_callback): Do not disconnect client on timeout, so
+       that the user can finish sending NICK/USER or doing iauth.
+
 2006-04-28  Michael Poole <mdpoole@troilus.org>
 
        * doc/example.conf (Admin): Fix documentation of which line can be
index d90896ddf27f1b6d41d1634317ae823fab257059..e64de671bbb9ddecf855b14570263192d3c5eb52 100644 (file)
@@ -96,7 +96,7 @@ struct AuthRequest {
   struct irc_sockaddr local;      /**< local endpoint address */
   struct irc_in_addr  original;   /**< original client IP address */
   struct Socket       socket;     /**< socket descriptor for auth queries */
-  struct Timer        timeout;    /**< timeout timer for auth queries */
+  struct Timer        timeout;    /**< timeout timer for ident and dns queries */
   struct AuthRequestFlags flags;  /**< current state of request */
   unsigned int        cookie;     /**< cookie the user must PONG */
   unsigned short      port;       /**< client's remote port number */
@@ -405,7 +405,7 @@ static int check_auth_finished(struct AuthRequest *auth, int send_reports)
 
       /* If iauth wants it, give client more time. */
       if (IAuthHas(iauth, IAUTH_EXTRAWAIT))
-        timer_chg(&auth->timeout, TT_RELATIVE, feature_int(FEAT_AUTH_TIMEOUT));
+        cli_firsttime(auth->client) = CurrentTime;
     }
 
     Debug((DEBUG_INFO, "Auth %p [%d] still has flag %d", auth,
@@ -415,7 +415,6 @@ static int check_auth_finished(struct AuthRequest *auth, int send_reports)
   else
     FlagSet(&auth->flags, AR_IAUTH_HURRY);
 
-
   destroy_auth_request(auth, send_reports);
   if (!IsUserPort(auth->client))
     return 0;
@@ -716,7 +715,8 @@ void destroy_auth_request(struct AuthRequest* auth, int send_reports)
     s_fd(&auth->socket) = -1;
   }
 
-  timer_del(&auth->timeout);
+  if (t_active(&auth->timeout))
+    timer_del(&auth->timeout);
   cli_auth(auth->client) = NULL;
 }
 
@@ -746,9 +746,6 @@ static void auth_timeout_callback(struct Event* ev)
     }
     /* Try to register the client. */
     check_auth_finished(auth, 1);
-    /* If that failed, kick them off. */
-    if (!IsUser(auth->client))
-      exit_client(auth->client, auth->client, &me, "Authorization timed out");
   }
 }