X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_banredirect.cpp;h=ee52a5cfbb8d058dfad23061c5872e475cf9c224;hb=86f8294c2de86b8d060abbb02f7c51c0ca0d9ead;hp=c2dff91267fd2621262a66628543567f253a697e;hpb=d0aa0fab53653ed86da9773c96acaa20021f0003;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index c2dff9126..ee52a5cfb 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -269,13 +269,6 @@ class ModuleBanRedirect : public Module virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven) { - /* This prevents recursion when a user sets multiple ban redirects in a chain - * (thanks Potter) - */ - if (nofollow) - return MOD_RES_PASSTHRU; - - /* Return 1 to prevent the join, 0 to allow it */ if (chan) { BanRedirectList* redirects = re.extItem.get(chan); @@ -303,6 +296,16 @@ class ModuleBanRedirect : public Module { if(InspIRCd::Match(user->GetFullRealHost(), redir->banmask) || InspIRCd::Match(user->GetFullHost(), redir->banmask) || InspIRCd::MatchCIDR(ipmask, redir->banmask)) { + /* This prevents recursion when a user sets multiple ban redirects in a chain + * (thanks Potter) + * + * If we're here and nofollow is true then we're already redirecting this user + * and there's a redirecting ban set on this channel that matches him, too. + * Deny both joins. + */ + if (nofollow) + return MOD_RES_DENY; + /* tell them they're banned and are being transferred */ Channel* destchan = ServerInstance->FindChan(redir->targetchan); std::string destlimit;