Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Mon, 25 Mar 2002 23:24:44 +0000 (23:24 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Mon, 25 Mar 2002 23:24:44 +0000 (23:24 +0000)
Log message:

If a user changes nickname to a nick that's banned on the channel, the ban
wouldn't take effect.  Although minor, this is a bug, and may best be fixed
by invalidating all the ban caching for the user.  This is effected by
looping over all the user's channel memberships and doing a ClearBanValid()
on them.

(pull-up from u2.10.11 branch)

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@685 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_user.c

index 23286f6f4a1ffcdc3048c3a199ab7d8acdea33a4..7a44c372324fe9f4d77cc70f420769e06515bf5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-25  Kevin L Mitchell  <klmitch@mit.edu>
+
+       * ircd/s_user.c (set_nick_name): invalidate all ban valid caching
+       when a user changes his nickname so we can catch if he now matches
+       a ban
+
 2002-03-20 Reed Loden <reed@redmagnet.com>
        * doc/example.conf: Added OPER_LIST_CHAN and LOCOP_LIST_CHAN.
 
index b61977c693b25d46cdb74b81ff4fdf37c4ef6230..2e7b49c8d6fb1435d7e7136c27e9d0cea5752cda 100644 (file)
@@ -729,6 +729,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
      */
     if (MyUser(sptr)) {
       const char* channel_name;
+      struct Membership *member;
       if ((channel_name = find_no_nickchange_channel(sptr))) {
         return send_reply(cptr, ERR_BANNICKCHANGE, channel_name);
       }
@@ -756,6 +757,10 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
         if (cli_nextnick(cptr) < CurrentTime)
           cli_nextnick(cptr) = CurrentTime;
       }
+      /* Invalidate all bans against the user so we check them again */
+      for (member = (cli_user(cptr))->channel; member;
+          member = member->next_channel)
+       ClearBanValid(member);
     }
     /*
      * Also set 'lastnick' to current time, if changed.