]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
when changing rcon_secure, always clear rcon_password, to prevent a send-as-plaintext...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Apr 2009 08:24:52 +0000 (08:24 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Apr 2009 08:24:52 +0000 (08:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8889 d7cf8633-e32d-0410-b094-e92efae38249

cvar.c
host_cmd.c

diff --git a/cvar.c b/cvar.c
index 47a5735ddeb16477d6bcd2dd8992feb42de12ce8..27ece13a84933c168b793413ddea8b345f1079aa 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -294,6 +294,13 @@ void Cvar_SetQuick_Internal (cvar_t *var, const char *value)
                        CL_SetInfo("playermodel", var->string, true, false, false, false);
                else if (!strcmp(var->name, "_cl_name"))
                        CL_SetInfo("name", var->string, true, false, false, false);
+               else if (!strcmp(var->name, "rcon_secure"))
+               {
+                       // whenever rcon_secure is changed, clear rcon_password for
+                       // security reasons (prevents a send-rcon-password-as-plaintext
+                       // attack based on NQ protocol session takeover and svc_stufftext)
+                       Cvar_Set("rcon_password", "");
+               }
        }
 }
 
index 6c051d9f0f8c0e83cc9715560619d9c83d2a8a1d..8b0b56a13324a15acc4ab3106e70ca8fce137fe8 100644 (file)
@@ -32,8 +32,8 @@ cvar_t sv_cheats = {0, "sv_cheats", "0", "enables cheat commands in any game, an
 cvar_t sv_adminnick = {CVAR_SAVE, "sv_adminnick", "", "nick name to use for admin messages instead of host name"};
 cvar_t sv_status_privacy = {CVAR_SAVE, "sv_status_privacy", "0", "do not show IP addresses in 'status' replies to clients"};
 cvar_t sv_status_show_qcstatus = {CVAR_SAVE, "sv_status_show_qcstatus", "0", "show the 'qcstatus' field in status replies, not the 'frags' field. Turn this on if your mod uses this field, and the 'frags' field on the other hand has no meaningful value."};
-cvar_t rcon_password = {CVAR_PRIVATE, "rcon_password", "", "password to authenticate rcon commands"};
-cvar_t rcon_secure = {0, "rcon_secure", "1", "force secure rcon authentication"};
+cvar_t rcon_password = {CVAR_PRIVATE, "rcon_password", "", "password to authenticate rcon commands; NOTE: changing rcon_secure clears rcon_password, so set rcon_secure always before rcon_password"};
+cvar_t rcon_secure = {CVAR_NQUSERINFOHACK, "rcon_secure", "1", "force secure rcon authentication; NOTE: changing rcon_secure clears rcon_password, so set rcon_secure always before rcon_password"};
 cvar_t rcon_address = {0, "rcon_address", "", "server address to send rcon commands to (when not connected to a server)"};
 cvar_t team = {CVAR_USERINFO | CVAR_SAVE, "team", "none", "QW team (4 character limit, example: blue)"};
 cvar_t skin = {CVAR_USERINFO | CVAR_SAVE, "skin", "", "QW player skin name (example: base)"};