Fix some other bugs when IAuth is not enabled.
authorMichael Poole <mdpoole@troilus.org>
Wed, 22 Feb 2006 15:34:45 +0000 (15:34 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 22 Feb 2006 15:34:45 +0000 (15:34 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1624 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_auth.c

index 123f3668b52df47f3ba6b64b5a3686a5644f8591..77ef30380c2034cb82690ee2cd2cf3371db27b74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-02-22  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/s_auth.c (check_auth_finished): Give non-iauth clients
+       connection classes, too.
+       (auth_close_unused): Remove redundant check for iauth != NULL.
+       (report_iauth_conf): Check iauth != NULL before deref'ing it.
+       (report_iauth_stats): Likewise.
+
 2006-02-22  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/s_auth.c: fix macros to not dereference a NULL pointer when
index 4cb8de4cd520c59ff5e6d70ba2eca1d58f77f7dc..03a2c26c5ea273aa93fa77fda5edebe2076e0745 100644 (file)
@@ -370,6 +370,12 @@ static int check_auth_finished(struct AuthRequest *auth, int send_reports)
       return 0;
     }
 
+  /* If appropriate, do preliminary assignment to connection class. */
+  if (IsUserPort(auth->client)
+      && !FlagHas(&auth->flags, AR_IAUTH_HURRY)
+      && preregister_user(auth->client))
+    return CPTR_KILLED;
+
   /* Check if iauth is done. */
   if (FlagHas(&auth->flags, AR_IAUTH_PENDING))
   {
@@ -381,10 +387,6 @@ static int check_auth_finished(struct AuthRequest *auth, int send_reports)
       /* Set "hurry" flag in auth request. */
       FlagSet(&auth->flags, AR_IAUTH_HURRY);
 
-      /* Do preliminary assignment to connection class. */
-      if (preregister_user(auth->client))
-        return CPTR_KILLED;
-
       /* Check password now (to avoid challenge/response conflicts). */
       aconf = cli_confs(auth->client)->value.aconf;
       if (!EmptyString(aconf->passwd)
@@ -408,6 +410,9 @@ static int check_auth_finished(struct AuthRequest *auth, int send_reports)
            cli_fd(auth->client), AR_IAUTH_PENDING));
     return 0;
   }
+  else
+    FlagSet(&auth->flags, AR_IAUTH_HURRY);
+
 
   destroy_auth_request(auth, send_reports);
   if (!IsUserPort(auth->client))
@@ -1263,7 +1268,7 @@ static void iauth_disconnect(struct IAuth *iauth)
 /** Close all %IAuth connections marked as closing. */
 void auth_close_unused(void)
 {
-  if (iauth && IAuthHas(iauth, IAUTH_CLOSING)) {
+  if (IAuthHas(iauth, IAUTH_CLOSING)) {
     int ii;
     iauth_disconnect(iauth);
     if (iauth->i_argv) {
@@ -2018,7 +2023,7 @@ void report_iauth_conf(struct Client *cptr, const struct StatDesc *sd, char *par
 {
     struct SLink *link;
 
-    for (link = iauth->i_config; link; link = link->next)
+    if (iauth) for (link = iauth->i_config; link; link = link->next)
     {
         send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s",
                    link->value.cp);
@@ -2035,7 +2040,7 @@ void report_iauth_conf(struct Client *cptr, const struct StatDesc *sd, char *par
 {
     struct SLink *link;
 
-    for (link = iauth->i_stats; link; link = link->next)
+    if (iauth) for (link = iauth->i_stats; link; link = link->next)
     {
         send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s",
                    link->value.cp);