From 338d645fcfa1f07a82c4940aa09a6fb265ff608f Mon Sep 17 00:00:00 2001 From: red-001 Date: Thu, 15 Feb 2018 20:18:54 +0000 Subject: Add `on_auth_fail` callback (#7039) Called when a client fails to supply the correct password for the account it's attempting to login as. --- src/network/serverpackethandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 6ea58a7ec..98697d72f 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -1735,10 +1735,12 @@ void Server::handleCommand_SrpBytesM(NetworkPacket* pkt) return; } + std::string ip = getPeerAddress(pkt->getPeerId()).serializeString(); actionstream << "Server: User " << client->getName() - << " at " << getPeerAddress(pkt->getPeerId()).serializeString() + << " at " << ip << " supplied wrong password (auth mechanism: SRP)." << std::endl; + m_script->on_auth_failure(client->getName(), ip); DenyAccess(pkt->getPeerId(), SERVER_ACCESSDENIED_WRONG_PASSWORD); return; } -- cgit v1.2.3