aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2015-10-12 21:25:11 +0200
committerKahrl <kahrl@gmx.net>2015-10-12 21:47:56 +0200
commite0b57c1140554fccbf3e57a036cc4100887ab8f1 (patch)
treedf4c7450a611dd957e3d6c54b68d2f59b8094155 /src/network
parent7f2cefa093aa14729bb49db85a49c7f9b3fed6a4 (diff)
downloadminetest-e0b57c1140554fccbf3e57a036cc4100887ab8f1.tar.gz
minetest-e0b57c1140554fccbf3e57a036cc4100887ab8f1.tar.bz2
minetest-e0b57c1140554fccbf3e57a036cc4100887ab8f1.zip
Fix how address is logged when a wrong password is supplied
- SRP: print the address only once, not twice - Legacy: previously the address was not printed at all - Make both messages structurally the same, to facilitate log analyzers
Diffstat (limited to 'src/network')
-rw-r--r--src/network/serverpackethandler.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index 3ee2dd931..0bf7e4769 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -568,8 +568,10 @@ void Server::handleCommand_Init_Legacy(NetworkPacket* pkt)
}
if (given_password != checkpwd) {
- actionstream << "Server: " << playername << " supplied wrong password"
- << std::endl;
+ actionstream << "Server: User " << playername
+ << " at " << addr_s
+ << " supplied wrong password (auth mechanism: legacy)."
+ << std::endl;
DenyAccess_Legacy(pkt->getPeerId(), L"Wrong password");
return;
}
@@ -2062,9 +2064,8 @@ void Server::handleCommand_SrpBytesM(NetworkPacket* pkt)
} else {
actionstream << "Server: User " << client->getName()
<< " at " << getPeerAddress(pkt->getPeerId()).serializeString()
- << " supplied wrong (SRP) password from address "
- << getPeerAddress(pkt->getPeerId()).serializeString()
- << "." << std::endl;
+ << " supplied wrong password (auth mechanism: SRP)."
+ << std::endl;
DenyAccess(pkt->getPeerId(), SERVER_ACCESSDENIED_WRONG_PASSWORD);
return;
}