summaryrefslogtreecommitdiff
path: root/src/core/cs_getpass.c
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-09 02:35:59 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-09 02:35:59 +0000
commit4ddc1cebd1b29b76ea78ee6c080ceebe9d83a513 (patch)
tree6f6c4e9c56cbe4766a552637e8fa6b88ee281b51 /src/core/cs_getpass.c
parent54762245b84519c5f2d805d6c4e9bf735895da78 (diff)
Fix bug #1028, the *_getpass and *_sendpass modules will now refuse to load if the given encryption module is unable to do decryption.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2147 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/cs_getpass.c')
-rw-r--r--src/core/cs_getpass.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/cs_getpass.c b/src/core/cs_getpass.c
index c26d4a349..019b8f09f 100644
--- a/src/core/cs_getpass.c
+++ b/src/core/cs_getpass.c
@@ -55,7 +55,7 @@ class CommandCSGetPass : public Command
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
return MOD_CONT;
}
- if(!enc_decrypt(ci->founderpass, tmp_pass, PASSMAX - 1)==1)
+ if (!enc_decrypt(ci->founderpass, tmp_pass, PASSMAX - 1))
{
notice_lang(s_ChanServ, u, CHAN_GETPASS_UNAVAILABLE);
return MOD_CONT;
@@ -98,6 +98,10 @@ class CSGetPass : public Module
this->AddCommand(CHANSERV, new CommandCSGetPass(), MOD_UNIQUE);
this->SetChanHelp(myChanServHelp);
+
+ char tmp_pass[PASSMAX];
+ if (!enc_decrypt("tmp", tmp_pass, PASSMAX - 1))
+ throw ModuleException("Incompatible with the encryption module being used");
}
};