summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-06 18:38:37 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-06 18:38:37 +0000
commit30de7a8603dd06df8099c8904f918caf1263d995 (patch)
treeaa8b3d562c83e5f2b1a88341fc5751fcba96caa3 /src
parent66a643121da3399e5c256df964a7563dd043528c (diff)
Allow CIDR channel bans to be matched
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4741 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 03bb3cc79..d354f2e62 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -348,11 +348,14 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
log(DEBUG,"add_channel: about to walk banlist");
MOD_RESULT = 0;
FOREACH_RESULT(I_OnCheckBan,OnCheckBan(user, Ptr));
+ char mask[MAXBUF];
+ sprintf(mask,"%s@%s",user->ident, user->GetIPString());
if (!MOD_RESULT)
{
for (BanList::iterator i = Ptr->bans.begin(); i != Ptr->bans.end(); i++)
{
- if ((match(user->GetFullHost(),i->data)) || (match(user->GetFullRealHost(),i->data)) || (match(user->GetIPString(),i->data)))
+ /* This allows CIDR ban matching */
+ if ((match(user->GetFullHost(),i->data)) || (match(user->GetFullRealHost(),i->data)) || (match(mask, i->data, true)))
{
WriteServ(user->fd,"474 %s %s :Cannot join channel (You're banned)",user->nick, Ptr->name);
return NULL;