summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-02-21 00:07:21 +0000
committerSadie Powell <sadie@witchery.services>2025-02-23 11:44:52 +0000
commit096c996900ff1d0771a5933038d5948265fd31d0 (patch)
tree5622158106c36fdb76ee34f495ab131ad0a8c000
parentab0a67c35cfad74d8f25e752eea1c039a36220bf (diff)
Fix resetting the SASL password limit.
-rw-r--r--modules/sasl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/sasl.cpp b/modules/sasl.cpp
index 29ac75883..f1a8f53bc 100644
--- a/modules/sasl.cpp
+++ b/modules/sasl.cpp
@@ -334,12 +334,12 @@ public:
auto it = badpasswords.find(session->uid);
if (it == badpasswords.end())
- it = badpasswords.emplace(session->uid, std::make_pair(Anope::CurTime, 0)).first;
+ it = badpasswords.emplace(session->uid, std::make_pair(0, 0)).first;
auto &[invalid_pw_time, invalid_pw_count] = it->second;
const auto badpasstimeout = Config->GetBlock("options")->Get<time_t>("badpasstimeout");
if (badpasstimeout > 0 && invalid_pw_time > 0 && invalid_pw_time < Anope::CurTime - badpasstimeout)
- badpasswords.erase(it);
+ invalid_pw_count = 0;
invalid_pw_count++;
invalid_pw_time = Anope::CurTime;