diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-04-11 00:29:07 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-04-11 00:29:07 +0000 |
commit | 1e9de0c7f146ec00d2dd6ee4cb9d86860a03ea9f (patch) | |
tree | c653f724f60fa569c62a8b44eab4c147d52f1b40 /src/actions.c | |
parent | 626afff37d1a31b2427700ac5a1dbdb32171afbc (diff) |
Return MOD_STOP in various places where the user executing the command had been killed, fixes a crash if a user gets killed for too many invalid passwords
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2885 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/actions.c b/src/actions.c index 39c646cce..eea1906ca 100644 --- a/src/actions.c +++ b/src/actions.c @@ -20,21 +20,26 @@ * Note a bad password attempt for the given user. If they've used up * their limit, toss them off. * @param u the User to check - * @return void + * @return true if the user was killed, otherwise false */ -void bad_password(User *u) +bool bad_password(User *u) { time_t now = time(NULL); if (!u || !Config.BadPassLimit) - return; + return false; if (Config.BadPassTimeout > 0 && u->invalid_pw_time > 0 && u->invalid_pw_time < now - Config.BadPassTimeout) u->invalid_pw_count = 0; ++u->invalid_pw_count; u->invalid_pw_time = now; if (u->invalid_pw_count >= Config.BadPassLimit) + { kill_user("", u->nick, "Too many invalid passwords"); + return true; + } + + return false; } /*************************************************************************/ |