summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c11
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;
}
/*************************************************************************/