X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_globalload.cpp;h=2c936d5ea3dbff4cc53fbc51cee10c83ee88e54c;hb=e950f568d0f571e9475aa38177486468714de4d3;hp=d623ed262344488ab604fc79a671a114b63a832e;hpb=26e7bb0b9a17a595d9935a1cae41b44504ad213e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index d623ed262..2c936d5ea 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -22,8 +22,6 @@ */ -/* $ModDesc: Allows global loading of a module. */ - #include "inspircd.h" /** Handle /GLOADMODULE @@ -35,7 +33,6 @@ class CommandGloadmodule : public Command { flags_needed = 'o'; syntax = " [servermask]"; - TRANSLATE3(TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle (const std::vector ¶meters, User *user) @@ -79,6 +76,13 @@ class CommandGunloadmodule : public Command CmdResult Handle (const std::vector ¶meters, 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)) @@ -180,14 +184,14 @@ class ModuleGlobalLoad : public Module { } - void init() + void init() CXX11_OVERRIDE { ServerInstance->Modules->AddService(cmd1); ServerInstance->Modules->AddService(cmd2); ServerInstance->Modules->AddService(cmd3); } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Allows global loading of a module.", VF_COMMON | VF_VENDOR); }