Fix oplevel handling in bursts, fixing SF bugs #2596869 and #2597518.
authorMichael Poole <mdpoole@troilus.org>
Thu, 7 Jan 2010 02:39:48 +0000 (02:39 +0000)
committerMichael Poole <mdpoole@troilus.org>
Thu, 7 Jan 2010 02:39:48 +0000 (02:39 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1935 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_burst.c

index 58cd3aca1b4e96e9e24ab78cd5f4c643cc2ed2da..ff7157f8ea0b16b31884fcfbc738bc256a861596 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-06  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/m_burst.c (ms_burst): Gracefully handle the case where a
+       server sends us a too-large oplevel.  Forward oplevels whenever
+       they are in use, not just when the channel is +A.
+
 2010-01-04  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/m_xquery.c (ms_xquery): Resolving my patches with
index 649898d22b83e586f28728aab3392ddb74b9f53e..f1e4429e32d0d0d9d273478240374f7abb6006f5 100644 (file)
@@ -509,6 +509,11 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
                  } while (IsDigit(*ptr));
                  --ptr;
                  oplevel += level_increment;
+                  if (oplevel > MAXOPLEVEL) {
+                    protocol_violation(sptr, "Invalid cumulative oplevel %u during burst", oplevel);
+                    oplevel = MAXOPLEVEL;
+                    break;
+                  }
                }
                else { /* I don't recognize that flag */
                  protocol_violation(sptr, "Invalid flag '%c' in nick part of burst", *ptr);
@@ -537,7 +542,7 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
              nickstr[nickpos++] = 'v';
            if (current_mode & CHFL_CHANOP)
             {
-              if (chptr->mode.apass[0])
+              if (oplevel != MAXOPLEVEL)
                nickpos += ircd_snprintf(0, nickstr + nickpos, sizeof(nickstr) - nickpos, "%u", oplevel);
               else
                 nickstr[nickpos++] = 'o';