From 30b7a1bf7fb0b422a6fd674f0cce95b3b0f92673 Mon Sep 17 00:00:00 2001 From: w00t Date: Sat, 25 Oct 2008 10:17:53 +0000 Subject: (sort of..) Revert commit 7736e920fe6ccaf9ad1984afc70db19efd4fb8cd - remove dupe checking on connect classes. Now, we just delete ones with refcount 0 on rehash, and add new ones. Connection can only match a non-disabled class, so most of the braindamage should be gone from here, without causing wild pointer fun.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10701 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 2b6e00e0e..784783086 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1830,6 +1830,9 @@ ConnectClass* User::SetClass(const std::string &explicit_name) { ConnectClass* c = *i; + if (c->GetDisabled()) + continue; // can't possibly match, removed from conf + if (explicit_name == c->GetName()) { ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Explicitly set to %s", explicit_name.c_str()); @@ -1852,6 +1855,13 @@ ConnectClass* User::SetClass(const std::string &explicit_name) ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "DENY %s %d %s", c->GetHost().c_str(), c->GetPort(), c->GetName().c_str()); } + /* if it's disabled, we can't match this one. */ + if (c->GetDisabled()) + { + ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Class disabled"); + continue; + } + /* check if host matches.. */ if (!InspIRCd::MatchCIDR(this->GetIPString(), c->GetHost(), NULL) && !InspIRCd::MatchCIDR(this->host, c->GetHost(), NULL)) -- cgit v1.2.3