From: Kevin L. Mitchell Date: Mon, 25 Mar 2002 23:24:44 +0000 (+0000) Subject: Author: Kev X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=cefff1235ef481abb64975db4187494ae962016a Author: Kev 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 --- diff --git a/ChangeLog b/ChangeLog index 23286f6..7a44c37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-03-25 Kevin L Mitchell + + * 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 * doc/example.conf: Added OPER_LIST_CHAN and LOCOP_LIST_CHAN. diff --git a/ircd/s_user.c b/ircd/s_user.c index b61977c..2e7b49c 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -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.