From 9b9326ff08565c6cf4acdc865884cc7c1f426822 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 4 Jun 2015 00:03:29 +0200 Subject: Expand module names in ServerConfig::ApplyModules() --- include/modules.h | 14 +++++++------- src/configreader.cpp | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/modules.h b/include/modules.h index 7944aa609..c938e6a9d 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1047,13 +1047,6 @@ class CoreExport ModuleManager : public fakederef */ bool PrioritizeHooks(); - /** Expands the name of a module by prepending "m_" and appending ".so". - * No-op if the name already has the ".so" extension. - * @param modname Module name to expand - * @return Module name starting with "m_" and ending with ".so" - */ - static std::string ExpandModName(const std::string& modname); - public: typedef std::map ModuleMap; @@ -1075,6 +1068,13 @@ class CoreExport ModuleManager : public fakederef */ ServiceList* NewServices; + /** Expands the name of a module by prepending "m_" and appending ".so". + * No-op if the name already has the ".so" extension. + * @param modname Module name to expand + * @return Module name starting with "m_" and ending with ".so" + */ + static std::string ExpandModName(const std::string& modname); + /** Simple, bog-standard, boring constructor. */ ModuleManager(); diff --git a/src/configreader.cpp b/src/configreader.cpp index 68495623c..974e52abf 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -671,6 +671,7 @@ void ServerConfig::ApplyModules(User* user) std::string name; if (tag->readString("name", name)) { + name = ModuleManager::ExpandModName(name); // if this module is already loaded, the erase will succeed, so we need do nothing // otherwise, we need to add the module (which will be done later) if (removed_modules.erase(name) == 0) -- cgit v1.2.3