diff options
author | Daniel De Graaf <danieldg@inspircd.org> | 2010-04-15 11:51:41 -0500 |
---|---|---|
committer | Daniel De Graaf <danieldg@inspircd.org> | 2010-04-15 11:51:41 -0500 |
commit | afd80b9db5693088c17c22c451f7875ea966d8a8 (patch) | |
tree | 0c04cdd1c71f01a0474d262716b78160ff2cdd71 /src | |
parent | 8fa7e20b6b47d4de617e1bba2773606df569f11d (diff) |
Fix cloak key being misread in 2.0 cloaking modes
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_cloaking.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index c17dedcbf..5a6e87486 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -384,10 +384,10 @@ class ModuleCloaking : public Module void OnRehash(User* user) { - ConfigReader Conf; - prefix = Conf.ReadValue("cloak","prefix",0); + ConfigTag* tag = ServerInstance->Config->ConfValue("cloak"); + prefix = tag->getString("prefix"); - std::string modestr = Conf.ReadValue("cloak", "mode", 0); + std::string modestr = tag->getString("mode"); if (modestr == "compat-host") mode = MODE_COMPAT_HOST; else if (modestr == "compat-ip") @@ -401,7 +401,7 @@ class ModuleCloaking : public Module if (mode == MODE_COMPAT_HOST || mode == MODE_COMPAT_IPONLY) { - bool lowercase = Conf.ReadFlag("cloak", "lowercase", 0); + bool lowercase = tag->getBool("lowercase"); /* These are *not* using the need_positive parameter of ReadInteger - * that will limit the valid values to only the positive values in a @@ -412,10 +412,10 @@ class ModuleCloaking : public Module * We must limit the keys or else we get different results on * amd64/x86 boxes. - psychon */ const unsigned int limit = 0x80000000; - compatkey[0] = (unsigned int) Conf.ReadInteger("cloak","key1",0,false); - compatkey[1] = (unsigned int) Conf.ReadInteger("cloak","key2",0,false); - compatkey[2] = (unsigned int) Conf.ReadInteger("cloak","key3",0,false); - compatkey[3] = (unsigned int) Conf.ReadInteger("cloak","key4",0,false); + compatkey[0] = (unsigned int) tag->getInt("key1"); + compatkey[1] = (unsigned int) tag->getInt("key2"); + compatkey[2] = (unsigned int) tag->getInt("key3"); + compatkey[3] = (unsigned int) tag->getInt("key4"); if (!lowercase) { @@ -453,7 +453,7 @@ class ModuleCloaking : public Module } else { - key = Conf.ReadFlag("cloak", "key", 0); + key = tag->getString("key"); if (key.empty() || key == "secret") throw ModuleException("You have not defined cloak keys for m_cloaking. Define <cloak:key> as a network-wide secret."); } |