summaryrefslogtreecommitdiff
path: root/src/modules/m_opermd5.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-04 22:40:57 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-04 22:40:57 +0000
commit54beb35ef189b58dee7851a60fdb0f7b2430855f (patch)
tree6fbdcd8772094d3e38ba827a766d4c7042d99a53 /src/modules/m_opermd5.cpp
parent697c14a75ec1211aa6da6395f429de3189ab73a7 (diff)
Tweaks, fixes, and comments
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5857 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_opermd5.cpp')
-rw-r--r--src/modules/m_opermd5.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/m_opermd5.cpp b/src/modules/m_opermd5.cpp
index 6e779f19b..127bdaa39 100644
--- a/src/modules/m_opermd5.cpp
+++ b/src/modules/m_opermd5.cpp
@@ -59,6 +59,7 @@ class ModuleOperMD5 : public Module
ModuleOperMD5(InspIRCd* Me)
: Module::Module(Me)
{
+ /* Try to find the md5 service provider, bail if it can't be found */
MD5Provider = ServerInstance->FindModule("m_md5.so");
if (!MD5Provider)
throw ModuleException("Can't find m_md5.so. Please load m_md5.so before m_opermd5.so.");
@@ -78,9 +79,11 @@ class ModuleOperMD5 : public Module
virtual int OnOperCompare(const std::string &data, const std::string &input)
{
+ /* always always reset first */
MD5ResetRequest(this, MD5Provider).Send();
if (data.length() == 32) // if its 32 chars long, try it as an md5
{
+ /* Does it match the md5 sum? */
if (!strcasecmp(data.c_str(), MD5SumRequest(this, MD5Provider, input.c_str()).Send()))
{
return 1;