]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cloaking.cpp
Fix for bug #415, affects only trunk (wish i'd known this before i started!)
[user/henk/code/inspircd.git] / src / modules / m_cloaking.cpp
index d4c4c4529d37d073e6b92af8ba657ccef1d6f0ca..d10f02ce466dcb2e233eb7919b999e5b385b4886 100644 (file)
@@ -254,12 +254,17 @@ class CloakUser : public ModeHandler
        {
                ConfigReader Conf(ServerInstance);
                bool lowercase;
-
+               
+               /* These are *not* using the need_positive parameter of ReadInteger - 
+                * that will limit the valid values to only the positive values in a
+                * signed int. Instead, accept any value that fits into an int and
+                * cast it to an unsigned int. That will, a bit oddly, give us the full
+                * spectrum of an unsigned integer. - Special */
                key1 = key2 = key3 = key4 = 0;
-               key1 = Conf.ReadInteger("cloak","key1",0,true);
-               key2 = Conf.ReadInteger("cloak","key2",0,true);
-               key3 = Conf.ReadInteger("cloak","key3",0,true);
-               key4 = Conf.ReadInteger("cloak","key4",0,true);
+               key1 = (unsigned int) Conf.ReadInteger("cloak","key1",0,false);
+               key2 = (unsigned int) Conf.ReadInteger("cloak","key2",0,false);
+               key3 = (unsigned int) Conf.ReadInteger("cloak","key3",0,false);
+               key4 = (unsigned int) Conf.ReadInteger("cloak","key4",0,false);
                prefix = Conf.ReadValue("cloak","prefix",0);
                ipalways = Conf.ReadFlag("cloak", "ipalways", 0);
                lowercase = Conf.ReadFlag("cloak", "lowercase", 0);
@@ -311,10 +316,10 @@ class ModuleCloaking : public Module
        ModuleCloaking(InspIRCd* Me)
                : Module(Me)
        {
-               ServerInstance->UseInterface("HashRequest");
+               ServerInstance->Modules->UseInterface("HashRequest");
 
                /* Attempt to locate the md5 service provider, bail if we can't find it */
-               HashModule = ServerInstance->FindModule("m_md5.so");
+               HashModule = ServerInstance->Modules->Find("m_md5.so");
                if (!HashModule)
                        throw ModuleException("Can't find m_md5.so. Please load m_md5.so before m_cloaking.so.");
 
@@ -332,7 +337,7 @@ class ModuleCloaking : public Module
        {
                ServerInstance->Modes->DelMode(cu);
                DELETE(cu);
-               ServerInstance->DoneWithInterface("HashRequest");
+               ServerInstance->Modules->DoneWithInterface("HashRequest");
        }
        
        virtual Version GetVersion()