diff --git a/help_variables.json b/help_variables.json index c53040e25..e18413f0b 100644 --- a/help_variables.json +++ b/help_variables.json @@ -1043,6 +1043,21 @@ "group-id": "9", "type": "string" }, + "cl_allow_uploads": { + "default": "0", + "group-id": "9", + "type": "boolean", + "values": [ + { + "description": "Don't allow uploads.", + "name": "0" + }, + { + "description": "Allow uploads.", + "name": "1" + } + ] + }, "cl_anglespeedkey": { "default": "1.5", "desc": "This variable sets multiplier by which your \"cl_yawspeed\" (how fast you turn) is multiplied when running (+speed).", diff --git a/src/cl_parse.c b/src/cl_parse.c index c4a106420..ca9f383ea 100644 --- a/src/cl_parse.c +++ b/src/cl_parse.c @@ -1287,7 +1287,13 @@ void CL_StartFileUpload (void) { char *name; int i; + extern cvar_t cl_allow_uploads; + if (!cl_allow_uploads.integer) + { + Com_Printf ("This command has been disabled for security reasons. Set cl_allow_uploads to 1 if you want to enable uploads.\n"); + return; + } if (cls.state < ca_onserver) { diff --git a/src/cmd.c b/src/cmd.c index 7c6669101..6ecd37f10 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -69,6 +69,7 @@ cvar_t cl_remote_capabilities = {"cl_remote_capabilities", REMOTE_CAPABILITIES, hashtable_t *rc_hash; cvar_t cl_allow_downloads = {"cl_allow_downloads", "bsp,lmp,loc,mdl,mvd,pcx,spr,wad,wav"}; +cvar_t cl_allow_uploads = {"cl_allow_uploads", "0"}; cbuf_t cbuf_main; cbuf_t cbuf_svc; @@ -2496,6 +2497,7 @@ void Cmd_Init (void) Cvar_Register(&cl_warnexec); Cvar_Register(&cl_remote_capabilities); Cvar_Register(&cl_allow_downloads); + Cvar_Register(&cl_allow_uploads); Cmd_AddCommand ("macrolist", Cmd_MacroList_f); qsort(msgtrigger_commands,