From d4df7be5a9ee0ba11869529600c1af930f6cec61 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 6 Aug 2006 19:43:47 +0000 Subject: CIDR g/k/e lines to go with zlines git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4744 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 4 ++-- src/xline.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/channels.cpp b/src/channels.cpp index 51d0c173c..1273ff07a 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -356,9 +356,9 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri { /* This allows CIDR ban matching * - * Full masked host Full unmasked host IP with CIDR IP without CIDR + * Full masked host Full unmasked host IP with/without CIDR */ - if ((match(user->GetFullHost(),i->data)) || (match(user->GetFullRealHost(),i->data)) || (match(mask, i->data, true)) || (match(mask, i->data, false))) + 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; diff --git a/src/xline.cpp b/src/xline.cpp index 32619b18c..830f6d7c6 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -443,10 +443,10 @@ char* matches_gline(const char* host) if ((glines.empty()) && (pglines.empty())) return NULL; for (std::vector::iterator i = glines.begin(); i != glines.end(); i++) - if (match(host,i->hostmask)) + if (match(host,i->hostmask, true)) return i->reason; for (std::vector::iterator i = pglines.begin(); i != pglines.end(); i++) - if (match(host,i->hostmask)) + if (match(host,i->hostmask, true)) return i->reason; return NULL; } @@ -458,10 +458,10 @@ char* matches_exception(const char* host) char host2[MAXBUF]; snprintf(host2,MAXBUF,"*@%s",host); for (std::vector::iterator i = elines.begin(); i != elines.end(); i++) - if ((match(host,i->hostmask)) || (match(host2,i->hostmask))) + if ((match(host,i->hostmask)) || (match(host2,i->hostmask, true))) return i->reason; for (std::vector::iterator i = pelines.begin(); i != pelines.end(); i++) - if ((match(host,i->hostmask)) || (match(host2,i->hostmask))) + if ((match(host,i->hostmask)) || (match(host2,i->hostmask, true))) return i->reason; return NULL; } @@ -558,10 +558,10 @@ char* matches_zline(const char* ipaddr) if ((zlines.empty()) && (pzlines.empty())) return NULL; for (std::vector::iterator i = zlines.begin(); i != zlines.end(); i++) - if (match(ipaddr,i->ipaddr,true)) + if (match(ipaddr,i->ipaddr, true)) return i->reason; for (std::vector::iterator i = pzlines.begin(); i != pzlines.end(); i++) - if (match(ipaddr,i->ipaddr,true)) + if (match(ipaddr,i->ipaddr, true)) return i->reason; return NULL; } @@ -573,10 +573,10 @@ char* matches_kline(const char* host) if ((klines.empty()) && (pklines.empty())) return NULL; for (std::vector::iterator i = klines.begin(); i != klines.end(); i++) - if (match(host,i->hostmask)) + if (match(host,i->hostmask, true)) return i->reason; for (std::vector::iterator i = pklines.begin(); i != pklines.end(); i++) - if (match(host,i->hostmask)) + if (match(host,i->hostmask, true)) return i->reason; return NULL; } -- cgit v1.2.3