Fix bug #916138 so -l doesn't gobble an argument.
authorMichael Poole <mdpoole@troilus.org>
Sat, 11 Sep 2004 15:51:41 +0000 (15:51 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 11 Sep 2004 15:51:41 +0000 (15:51 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1120 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c

index bbc1a97e2e01a44b474ed44d105f5040da9bb323..be3867cd546c395410b7fb98b14300a9b7949700 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-09-11  Kevin L Mitchell  <klmitch@mit.edu>
+
+       * ircd/channel.c: removing limits shouldn't gobble an argument;
+       this was a subtle interaction issue with modebuf...fixed by adding
+       MODE_LIMIT to modebuf_flush_int() and short-circuiting
+       modebuf_mode_uint() to add MODE_LIMIT to mbuf->mb_rem in the
+       removal case.  Note that this is not proof against the sequence,
+       "modebuf_mode_uint(mbuf, MODE_ADD | MODE_LIMIT, 10);
+       modebuf_mode_uint(mbuf, MODE_DEL | MODE_LIMIT, 10);"
+       (Bug #916138)
+
 2004-09-11  Michael Poole <mdpoole@troilus.org>
 
        * include/supported.h: Kev pointed out I misinterpreted the
index 06634693c37e6088e4f389646bab7e53bf8b9769..29b773488fcd0e07e72461b8242a490c67353b2f 100644 (file)
@@ -1524,7 +1524,7 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all)
     MODE_WASDELJOINS,   'd',
 /*  MODE_KEY,          'k', */
 /*  MODE_BAN,          'b', */
-/*  MODE_LIMIT,                'l', */
+    MODE_LIMIT,                'l',
 /*  MODE_APASS,                'A', */
 /*  MODE_UPASS,                'u', */
     0x0, 0x0
@@ -1930,6 +1930,10 @@ modebuf_mode_uint(struct ModeBuf *mbuf, unsigned int mode, unsigned int uint)
   assert(0 != mbuf);
   assert(0 != (mode & (MODE_ADD | MODE_DEL)));
 
+  if (mode == (MODE_LIMIT | MODE_DEL)) {
+      mbuf->mb_rem |= mode;
+      return;
+  }
   MB_TYPE(mbuf, mbuf->mb_count) = mode;
   MB_UINT(mbuf, mbuf->mb_count) = uint;