From: divverent Date: Tue, 3 Nov 2009 21:12:19 +0000 (+0000) Subject: hide private cvars from the output of cvar name and cvarlist commands to prevent... X-Git-Tag: xonotic-v0.1.0preview~1221 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=190ec39e2d932f612f29f712d0ab4a721c806520 hide private cvars from the output of cvar name and cvarlist commands to prevent password sniffing by evil CSQC tab completion still shows their value because that cannot be triggered by CSQC code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9421 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cvar.c b/cvar.c index 822f6e5e..afdbcf05 100644 --- a/cvar.c +++ b/cvar.c @@ -563,7 +563,7 @@ qboolean Cvar_Command (void) // perform a variable print or set if (Cmd_Argc() == 1) { - Con_Printf("\"%s\" is \"%s\" [\"%s\"]\n", v->name, v->string, v->defstring); + Con_Printf("\"%s\" is \"%s\" [\"%s\"]\n", v->name, ((v->flags & CVAR_PRIVATE) ? "********" : v->string), v->defstring); return true; } @@ -695,7 +695,7 @@ void Cvar_List_f (void) if (len && (ispattern ? !matchpattern_with_separator(cvar->name, partial, false, "", false) : strncmp (partial,cvar->name,len))) continue; - Con_Printf("%s is \"%s\" [\"%s\"] %s\n", cvar->name, cvar->string, cvar->defstring, cvar->description); + Con_Printf("%s is \"%s\" [\"%s\"] %s\n", cvar->name, ((cvar->flags & CVAR_PRIVATE) ? "********" : cvar->string), cvar->defstring, cvar->description); count++; }