X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_globalload.cpp;h=6c6dd769eff9d82133b98901cc4f7b39b54356e8;hb=226a95aab09b9e1f43f61e78179bfa1135816c2d;hp=22286b950e9dead2a72f93873b440a7be4b91f4c;hpb=349106f3f9f75d7f957fc5d1e71ca650f4807bb9;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 22286b950..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 ¶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)) @@ -187,10 +194,6 @@ class ModuleGlobalLoad : public Module ServerInstance->Modules->AddService(cmd3); } - ~ModuleGlobalLoad() - { - } - Version GetVersion() { return Version("Allows global loading of a module.", VF_COMMON | VF_VENDOR); @@ -198,4 +201,3 @@ class ModuleGlobalLoad : public Module }; MODULE_INIT(ModuleGlobalLoad) -