diff options
-rw-r--r-- | conf/modules.conf.example | 5 | ||||
-rw-r--r-- | conf/opers.conf.example | 9 | ||||
-rw-r--r-- | include/users.h | 4 | ||||
-rw-r--r-- | src/command_parse.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_operflood.cpp | 41 | ||||
-rw-r--r-- | src/userprocess.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 6 |
7 files changed, 12 insertions, 57 deletions
diff --git a/conf/modules.conf.example b/conf/modules.conf.example index 16ec438b4..81e9f99a8 100644 --- a/conf/modules.conf.example +++ b/conf/modules.conf.example @@ -1033,11 +1033,6 @@ #<module name="m_operchans.so"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Oper flood module: Removes flood limits from users upon opering up -# This module is oper-only. -#<module name="m_operflood.so"> - -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Oper invex/extban module: Adds +beI type O, to ban, exempt, and invex # given oper type masks. # e.g, /mode #channel +iI O:* is equivilant to chmode +O, but you diff --git a/conf/opers.conf.example b/conf/opers.conf.example index cc085f53c..c16416a48 100644 --- a/conf/opers.conf.example +++ b/conf/opers.conf.example @@ -22,11 +22,16 @@ # - channels/auspex: allows opers with this priv to see more detail about channels than normal users. # - users/auspex: allows opers with this priv to view more details about users than normal users. # - servers/auspex: allows opers with this priv to see more detail about server information than normal users. - # ACTIONS + # ACTIONS: # - users/mass-message: allows opers with this priv to PRIVMSG and NOTICE to a server mask (e.g. NOTICE $*) # - channels/high-join-limit: allows opers with this priv to join <channels:opers> total channels instead of <channels:users> total channels. # - channels/set-permanent: allows opers with this priv to set +P on channels with m_permchannels. - privs="users/auspex channels/auspex servers/auspex users/mass-message channels/high-join-limit channels/set-permanent" + # PERMISSIONS: + # - users/flood/no-throttle: allows opers with this priv to send commands without being throttled (*NOTE) + # - users/flood/increased-buffers: allows opers with this priv to send and recieve data without worrying about being disconnected for exceeding limits (*NOTE) + # + # *NOTE: These privs are potantially dangerous, as they grant users with them the ability to hammer your server's CPU/RAM as much as they want, essentially. + privs="users/auspex channels/auspex servers/auspex users/mass-message channels/high-join-limit channels/set-permanent users/flood/no-throttle users/flood/increased-buffers" # usermodes: Oper-only usermodes that opers with this class can use. usermodes="*" diff --git a/include/users.h b/include/users.h index 729121bea..6bb37f3e0 100644 --- a/include/users.h +++ b/include/users.h @@ -693,10 +693,6 @@ class CoreExport User : public EventHandler */ int Penalty; - /** If this bool is set then penalty rules do not apply to this user - */ - bool ExemptFromPenalty; - /** Default constructor * @throw CoreException if the UID allocated to the user already exists * @param Instance Creator instance diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 886824d20..1b91a86ef 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -352,7 +352,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) /* Modify the user's penalty */ bool do_more = true; - if (!user->ExemptFromPenalty) + if (!user->HasPrivPermission("users/flood/no-throttle")) { user->IncreasePenalty(cm->second->Penalty); do_more = (user->Penalty < 10); diff --git a/src/modules/m_operflood.cpp b/src/modules/m_operflood.cpp deleted file mode 100644 index d7c651c06..000000000 --- a/src/modules/m_operflood.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ - * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits - * - * This program is free but copyrighted software; see - * the file COPYING for details. - * - * --------------------------------------------------- - */ - -#include "inspircd.h" - -/* $ModDesc: Removes flood limits from users upon opering up. */ -class ModuleOperFlood : public Module -{ -public: - ModuleOperFlood(InspIRCd * Me) : Module(Me) - { - Implementation eventlist[] = { I_OnPostOper }; - ServerInstance->Modules->Attach(eventlist, this, 1); - } - - Version GetVersion() - { - return Version("$Id$", VF_VENDOR, API_VERSION); - } - - void OnPostOper(User* user, const std::string &opertype, const std::string &opername) - { - if(!IS_LOCAL(user)) - return; - - user->ExemptFromPenalty = true; - user->WriteServ("NOTICE %s :*** You are now free from flood limits.", user->nick.c_str()); - } -}; - -MODULE_INIT(ModuleOperFlood) diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 1f6eac6e9..a529f4476 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -131,7 +131,7 @@ void ProcessUserHandler::Call(User* cu) } /* If user is over penalty, dont process here, just build up */ - if (!curr->Penalty < 10) + if (!current->Penalty < 10) Server->Parser->DoLines(current); return; diff --git a/src/users.cpp b/src/users.cpp index 18ab02837..48e0bcd12 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -214,7 +214,7 @@ User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance Penalty = 0; lines_in = lastping = signon = idle_lastmsg = nping = registered = 0; bytes_in = bytes_out = cmds_in = cmds_out = 0; - quietquit = ExemptFromPenalty = quitting = exempt = haspassed = dns_done = false; + quietquit = quitting = exempt = haspassed = dns_done = false; fd = -1; recvq.clear(); sendq.clear(); @@ -613,7 +613,7 @@ bool User::AddBuffer(const std::string &a) } } - if (this->MyClass && (recvq.length() > this->MyClass->GetRecvqMax())) + if (this->MyClass && !this->HasPrivPermission("users/flood/increased-buffers") && recvq.length() > this->MyClass->GetRecvqMax()) { ServerInstance->Users->QuitUser(this, "RecvQ exceeded"); ServerInstance->SNO->WriteToSnoMask('A', "User %s RecvQ of %lu exceeds connect class maximum of %lu",this->nick.c_str(),(unsigned long int)recvq.length(),this->MyClass->GetRecvqMax()); @@ -678,7 +678,7 @@ void User::AddWriteBuf(const std::string &data) if (this->quitting) return; - if (this->MyClass && (sendq.length() + data.length() > this->MyClass->GetSendqMax())) + if (this->MyClass && !this->HasPrivPermission("users/flood/increased-buffers") && sendq.length() + data.length() > this->MyClass->GetSendqMax()) { /* * Fix by brain - Set the error text BEFORE calling, because |