From: Michael Poole Date: Sat, 11 Sep 2004 15:51:41 +0000 (+0000) Subject: Fix bug #916138 so -l doesn't gobble an argument. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=fea343ea831e3b6921d7333a1b729c3cfcde81bb Fix bug #916138 so -l doesn't gobble an argument. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1120 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index bbc1a97..be3867c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-09-11 Kevin L Mitchell + + * 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 * include/supported.h: Kev pointed out I misinterpreted the diff --git a/ircd/channel.c b/ircd/channel.c index 0663469..29b7734 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -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;