1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-12-23 06:55:30 +01:00

Fix singleplayer lockout when changing password (#16673)

This commit is contained in:
Starkiller1St
2025-12-20 15:13:04 +01:00
committed by GitHub
parent f567449cd6
commit 4cb32467d3

View File

@@ -1660,7 +1660,9 @@ void Server::handleCommand_SrpBytesM(NetworkPacket* pkt)
srp_verifier_verify_session((SRPVerifier *) client->auth_data,
(unsigned char *)bytes_M.c_str(), &bytes_HAMK);
if (!bytes_HAMK) {
// skip authentication check for singleplayer world.
const bool is_true_singleplayer = isSingleplayer() && (strcasecmp(playername.c_str(), "singleplayer") == 0);
if (!bytes_HAMK && !is_true_singleplayer) {
if (wantSudo) {
actionstream << "Server: User " << playername << " at " << addr_s
<< " tried to change their password, but supplied wrong"