From 77de540208d2a080a6f758010a7baa3bd5d6824e Mon Sep 17 00:00:00 2001 From: WPMGPRoSToTeMa Date: Mon, 8 Feb 2016 16:07:01 +0300 Subject: [PATCH] Fixed password checks --- rehlds/engine/sv_main.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index a90ee25..9401948 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -2139,10 +2139,10 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in if (!NET_IsLocalAddress(*adr)) { - if (sv_password.string[0] != 0 && Q_stricmp(sv_password.string, "none")) - { - const char* password = Info_ValueForKey(userinfo, "password"); + const char* password = Info_ValueForKey(userinfo, "password"); + if (sv_password.string[0] != '\0' && Q_stricmp(sv_password.string, "none") && Q_strcmp(sv_password.string, password)) + { #ifdef REHLDS_FIXES if (password[0] == '\0') { @@ -2150,9 +2150,7 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in SV_RejectConnection(adr, "No password set. Clean your userinfo.\n"); } else -#endif - - if (Q_strcmp(sv_password.string, password)) +#endif // REHLDS_FIXES { Con_Printf("%s: password failed\n", NET_AdrToString(*adr)); SV_RejectConnectionForPassword(adr);