X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_globalload.cpp;h=6c6dd769eff9d82133b98901cc4f7b39b54356e8;hb=226a95aab09b9e1f43f61e78179bfa1135816c2d;hp=5ece450810de48abe69a0b2160085bd522326ff8;hpb=ac7defcd3e52695dcf5e5150e9fe3e1624205e64;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 5ece45081..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)) @@ -182,13 +189,9 @@ class ModuleGlobalLoad : public Module void init() { - ServerInstance->AddCommand(&cmd1); - ServerInstance->AddCommand(&cmd2); - ServerInstance->AddCommand(&cmd3); - } - - ~ModuleGlobalLoad() - { + ServerInstance->Modules->AddService(cmd1); + ServerInstance->Modules->AddService(cmd2); + ServerInstance->Modules->AddService(cmd3); } Version GetVersion() @@ -198,4 +201,3 @@ class ModuleGlobalLoad : public Module }; MODULE_INIT(ModuleGlobalLoad) -