summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-04-07 17:02:37 +0100
committerPeter Powell <petpow@saberuk.com>2013-04-13 16:01:42 +0100
commitb331d0549be435d77ceb52aee4a58ee4aa40ec7d (patch)
treec7c7c4cdf38d1c69828a8ed9c022851f75b44936 /src/modules
parent1626437cbf963b16ce44ef6cc829957fd3a7e2ff (diff)
Add <security:allowcoreunload>.
When enabled (the default) this setting prevents the unloading of core modules such as cmd_privmsg.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_globalload.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp
index d623ed262..6c6dd769e 100644
--- a/src/modules/m_globalload.cpp
+++ b/src/modules/m_globalload.cpp
@@ -79,6 +79,13 @@ class CommandGunloadmodule : public Command
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
{
+ if (!ServerInstance->Config->ConfValue("security")->getBool("allowcoreunload") &&
+ InspIRCd::Match(parameters[0], "cmd_*.so", ascii_case_insensitive_map))
+ {
+ user->WriteNumeric(972, "%s %s :You cannot unload core commands!", user->nick.c_str(), parameters[0].c_str());
+ return CMD_FAILURE;
+ }
+
std::string servername = parameters.size() > 1 ? parameters[1] : "*";
if (InspIRCd::Match(ServerInstance->Config->ServerName.c_str(), servername))