From 4c09dec19754390d5542b8a4847d0dc081d2514b Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 5 Dec 2006 21:09:55 +0000 Subject: Make hash algo names case insensitive git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5873 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_oper_hash.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/modules/m_oper_hash.cpp b/src/modules/m_oper_hash.cpp index 6f0684643..036bbed1b 100644 --- a/src/modules/m_oper_hash.cpp +++ b/src/modules/m_oper_hash.cpp @@ -32,10 +32,10 @@ using namespace std; class cmd_mkpasswd : public command_t { Module* Sender; - std::map &hashers; + std::map &hashers; std::deque &names; public: - cmd_mkpasswd (InspIRCd* Instance, Module* S, std::map &h, std::deque &n) + cmd_mkpasswd (InspIRCd* Instance, Module* S, std::map &h, std::deque &n) : command_t(Instance,"MKPASSWD", 'o', 2), Sender(S), hashers(h), names(n) { this->source = "m_oper_hash.so"; @@ -44,7 +44,7 @@ class cmd_mkpasswd : public command_t void MakeHash(userrec* user, const char* algo, const char* stuff) { - std::map::iterator x = hashers.find(algo); + std::map::iterator x = hashers.find(algo); if (x != hashers.end()) { HashResetRequest(Sender, x->second).Send(); @@ -72,7 +72,7 @@ class ModuleOperHash : public Module cmd_mkpasswd* mycommand; ConfigReader* Conf; - std::map hashers; + std::map hashers; std::deque names; modulelist* ml; @@ -93,7 +93,7 @@ class ModuleOperHash : public Module for (modulelist::iterator m = ml->begin(); m != ml->end(); m++) { std::string name = HashNameRequest(this, *m).Send(); - hashers[name] = *m; + hashers[name.c_str()] = *m; names.push_back(name); ServerInstance->Log(DEBUG, "Found HashRequest interface: '%s' -> '%08x'", name.c_str(), *m); } @@ -123,7 +123,7 @@ class ModuleOperHash : public Module virtual int OnOperCompare(const std::string &data, const std::string &input, int tagnumber) { std::string hashtype = Conf->ReadValue("oper", "hash", tagnumber); - std::map::iterator x = hashers.find(hashtype); + std::map::iterator x = hashers.find(hashtype.c_str()); if (x != hashers.end()) { -- cgit v1.2.3