From 94dc74a37f01217ad6a9f8e6a0713f824f9359a8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 2 Nov 2021 12:51:47 +0600 Subject: [PATCH] engine: restrict potentially harmful engine commands --- engine/client/cl_main.c | 12 +++++------ engine/client/in_touch.c | 34 ++++++++++++++++---------------- engine/client/keys.c | 12 +++++------ engine/client/vid_common.c | 2 +- engine/common/common.h | 1 + engine/common/cvar.c | 6 +++--- engine/common/filesystem.c | 6 +++--- engine/common/host.c | 18 ++++++++--------- engine/common/hpak.c | 8 ++++---- engine/common/identification.c | 6 +++--- engine/common/net_ws.c | 8 ++++---- engine/platform/linux/in_evdev.c | 6 +++--- engine/platform/linux/s_alsa.c | 2 +- engine/server/sv_cmds.c | 18 ++++++++--------- engine/server/sv_filter.c | 16 +++++++-------- 15 files changed, 78 insertions(+), 77 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index fc34a633..4d644979 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2876,7 +2876,7 @@ void CL_InitLocal( void ) Cmd_AddCommand ("give", NULL, "give specified item or weapon" ); Cmd_AddCommand ("drop", NULL, "drop current/specified item or weapon" ); Cmd_AddCommand ("gametitle", NULL, "show game logo" ); - Cmd_AddCommand( "kill", NULL, "die instantly" ); + Cmd_AddRestrictedCommand ("kill", NULL, "die instantly" ); Cmd_AddCommand ("god", NULL, "enable godmode" ); Cmd_AddCommand ("fov", NULL, "set client field of view" ); Cmd_AddCommand ("log", NULL, "logging server events" ); @@ -2889,8 +2889,8 @@ void CL_InitLocal( void ) Cmd_AddCommand ("mp3", CL_PlayCDTrack_f, "Play mp3-track (based on virtual cd-player)" ); Cmd_AddCommand ("waveplaylen", CL_WavePlayLen_f, "Get approximate length of wave file"); - Cmd_AddCommand ("setinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of userinfo)" ); - Cmd_AddCommand ("userinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of setinfo)" ); + Cmd_AddRestrictedCommand ("setinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of userinfo)" ); + Cmd_AddRestrictedCommand ("userinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of setinfo)" ); Cmd_AddCommand ("physinfo", CL_Physinfo_f, "print current client physinfo" ); Cmd_AddCommand ("disconnect", CL_Disconnect_f, "disconnect from server" ); Cmd_AddCommand ("record", CL_Record_f, "record a demo" ); @@ -2909,8 +2909,8 @@ void CL_InitLocal( void ) Cmd_AddCommand ("fullserverinfo", CL_FullServerinfo_f, "sent by server when serverinfo changes" ); Cmd_AddCommand ("upload", CL_BeginUpload_f, "uploading file to the server" ); - Cmd_AddCommand ("quit", CL_Quit_f, "quit from game" ); - Cmd_AddCommand ("exit", CL_Quit_f, "quit from game" ); + Cmd_AddRestrictedCommand ("quit", CL_Quit_f, "quit from game" ); + Cmd_AddRestrictedCommand ("exit", CL_Quit_f, "quit from game" ); Cmd_AddCommand ("screenshot", CL_ScreenShot_f, "takes a screenshot of the next rendered frame" ); Cmd_AddCommand ("snapshot", CL_SnapShot_f, "takes a snapshot of the next rendered frame" ); @@ -2919,7 +2919,7 @@ void CL_InitLocal( void ) Cmd_AddCommand ("levelshot", CL_LevelShot_f, "same as \"screenshot\", used for create plaque images" ); Cmd_AddCommand ("saveshot", CL_SaveShot_f, "used for create save previews with LoadGame menu" ); - Cmd_AddCommand ("connect", CL_Connect_f, "connect to a server by hostname" ); + Cmd_AddRestrictedCommand ("connect", CL_Connect_f, "connect to a server by hostname" ); Cmd_AddCommand ("reconnect", CL_Reconnect_f, "reconnect to current level" ); Cmd_AddCommand ("rcon", CL_Rcon_f, "sends a command to the server console (rcon_password and rcon_address required)" ); diff --git a/engine/client/in_touch.c b/engine/client/in_touch.c index 812d6471..69566340 100644 --- a/engine/client/in_touch.c +++ b/engine/client/in_touch.c @@ -1023,18 +1023,18 @@ void Touch_Init( void ) Cmd_AddCommand( "touch_show", Touch_Show_f, "show button" ); Cmd_AddCommand( "touch_hide", Touch_Hide_f, "hide button" ); Cmd_AddCommand( "touch_list", Touch_ListButtons_f, "list buttons" ); - Cmd_AddCommand( "touch_removeall", Touch_RemoveAll_f, "remove all buttons" ); - Cmd_AddCommand( "touch_loaddefaults", Touch_LoadDefaults_f, "generate config from defaults" ); + Cmd_AddRestrictedCommand( "touch_removeall", Touch_RemoveAll_f, "remove all buttons" ); + Cmd_AddRestrictedCommand( "touch_loaddefaults", Touch_LoadDefaults_f, "generate config from defaults" ); Cmd_AddCommand( "touch_roundall", Touch_RoundAll_f, "round all buttons coordinates to grid" ); - Cmd_AddCommand( "touch_exportconfig", Touch_ExportConfig_f, "export config keeping aspect ratio" ); + Cmd_AddRestrictedCommand( "touch_exportconfig", Touch_ExportConfig_f, "export config keeping aspect ratio" ); Cmd_AddCommand( "touch_set_stroke", Touch_Stroke_f, "set global stroke width and color" ); Cmd_AddCommand( "touch_setclientonly", Touch_SetClientOnly_f, "when 1, only client buttons are shown" ); - Cmd_AddCommand( "touch_reloadconfig", Touch_ReloadConfig_f, "load config, not saving changes" ); - Cmd_AddCommand( "touch_writeconfig", Touch_WriteConfig, "save current config" ); - Cmd_AddCommand( "touch_deleteprofile", Touch_DeleteProfile_f, "delete profile by name" ); + Cmd_AddRestrictedCommand( "touch_reloadconfig", Touch_ReloadConfig_f, "load config, not saving changes" ); + Cmd_AddRestrictedCommand( "touch_writeconfig", Touch_WriteConfig, "save current config" ); + Cmd_AddRestrictedCommand( "touch_deleteprofile", Touch_DeleteProfile_f, "delete profile by name" ); Cmd_AddCommand( "touch_generate_code", Touch_GenerateCode_f, "create code sample for mobility API" ); Cmd_AddCommand( "touch_fade", Touch_Fade_f, "start fade animation for selected buttons" ); - Cmd_AddCommand( "touch_toggleselection", Touch_ToggleSelection_f, "toggle vidibility on selected button in editor" ); + Cmd_AddRestrictedCommand( "touch_toggleselection", Touch_ToggleSelection_f, "toggle vidibility on selected button in editor" ); // not saved, just runtime state for scripting touch_in_menu = Cvar_Get( "touch_in_menu", "0", 0, "draw touch in menu (for internal use only)" ); @@ -1050,22 +1050,22 @@ void Touch_Init( void ) touch_exp_mult = Cvar_Get( "touch_exp_mult", "0", 0, "exponent multiplier, usually 20-200, 0 to disable" ); // touch.cfg - touch_grid_count = Cvar_Get( "touch_grid_count", "50", 0, "touch grid count" ); - touch_grid_enable = Cvar_Get( "touch_grid_enable", "1", 0, "enable touch grid" ); - touch_config_file = Cvar_Get( "touch_config_file", "touch.cfg", FCVAR_ARCHIVE, "current touch profile file" ); - touch_precise_amount = Cvar_Get( "touch_precise_amount", "0.5", 0, "sensitivity multiplier for precise-look" ); + touch_grid_count = Cvar_Get( "touch_grid_count", "50", FCVAR_LOCALONLY, "touch grid count" ); + touch_grid_enable = Cvar_Get( "touch_grid_enable", "1", FCVAR_LOCALONLY, "enable touch grid" ); + touch_config_file = Cvar_Get( "touch_config_file", "touch.cfg", FCVAR_ARCHIVE | FCVAR_LOCALONLY, "current touch profile file" ); + touch_precise_amount = Cvar_Get( "touch_precise_amount", "0.5", FCVAR_LOCALONLY, "sensitivity multiplier for precise-look" ); touch_highlight_r = Cvar_Get( "touch_highlight_r", "1.0", 0, "highlight r color" ); touch_highlight_g = Cvar_Get( "touch_highlight_g", "1.0", 0, "highlight g color" ); touch_highlight_b = Cvar_Get( "touch_highlight_b", "1.0", 0, "highlight b color" ); touch_highlight_a = Cvar_Get( "touch_highlight_a", "1.0", 0, "highlight alpha" ); - touch_dpad_radius = Cvar_Get( "touch_dpad_radius", "1.0", 0, "dpad radius multiplier" ); - touch_joy_radius = Cvar_Get( "touch_joy_radius", "1.0", 0, "joy radius multiplier" ); - touch_move_indicator = Cvar_Get( "touch_move_indicator", "0.0", 0, "indicate move events (0 to disable)" ); - touch_joy_texture = Cvar_Get( "touch_joy_texture", "touch_default/joy.tga", 0, "texture for move indicator"); + touch_dpad_radius = Cvar_Get( "touch_dpad_radius", "1.0", FCVAR_LOCALONLY, "dpad radius multiplier" ); + touch_joy_radius = Cvar_Get( "touch_joy_radius", "1.0", FCVAR_LOCALONLY, "joy radius multiplier" ); + touch_move_indicator = Cvar_Get( "touch_move_indicator", "0.0", FCVAR_LOCALONLY, "indicate move events (0 to disable)" ); + touch_joy_texture = Cvar_Get( "touch_joy_texture", "touch_default/joy.tga", FCVAR_LOCALONLY, "texture for move indicator"); // input devices cvar - touch_enable = Cvar_Get( "touch_enable", DEFAULT_TOUCH_ENABLE, FCVAR_ARCHIVE, "enable touch controls" ); - touch_emulate = Cvar_Get( "touch_emulate", "0", FCVAR_ARCHIVE, "emulate touch with mouse" ); + touch_enable = Cvar_Get( "touch_enable", DEFAULT_TOUCH_ENABLE, FCVAR_ARCHIVE | FCVAR_LOCALONLY, "enable touch controls" ); + touch_emulate = Cvar_Get( "touch_emulate", "0", FCVAR_ARCHIVE | FCVAR_LOCALONLY, "emulate touch with mouse" ); /// TODO: touch sdl platform // SDL_SetHint( SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH, "1" ); diff --git a/engine/client/keys.c b/engine/client/keys.c index de13ef3e..0c2e01a1 100644 --- a/engine/client/keys.c +++ b/engine/client/keys.c @@ -512,18 +512,18 @@ void Key_Init( void ) keyname_t *kn; // register our functions - Cmd_AddCommand( "bind", Key_Bind_f, "binds a command to the specified key in bindmap" ); - Cmd_AddCommand( "unbind", Key_Unbind_f, "removes a command on the specified key in bindmap" ); - Cmd_AddCommand( "unbindall", Key_Unbindall_f, "removes all commands from all keys in bindmap" ); - Cmd_AddCommand( "resetkeys", Key_Reset_f, "reset all keys to their default values" ); + Cmd_AddRestrictedCommand( "bind", Key_Bind_f, "binds a command to the specified key in bindmap" ); + Cmd_AddRestrictedCommand( "unbind", Key_Unbind_f, "removes a command on the specified key in bindmap" ); + Cmd_AddRestrictedCommand( "unbindall", Key_Unbindall_f, "removes all commands from all keys in bindmap" ); + Cmd_AddRestrictedCommand( "resetkeys", Key_Reset_f, "reset all keys to their default values" ); Cmd_AddCommand( "bindlist", Key_Bindlist_f, "display current key bindings" ); Cmd_AddCommand( "makehelp", Key_EnumCmds_f, "write help.txt that contains all console cvars and cmds" ); // setup default binding. "unbindall" from config.cfg will be reset it for( kn = keynames; kn->name; kn++ ) Key_SetBinding( kn->keynum, kn->binding ); - osk_enable = Cvar_Get( "osk_enable", "0", FCVAR_ARCHIVE, "enable built-in on-screen keyboard" ); - key_rotate = Cvar_Get( "key_rotate", "0", FCVAR_ARCHIVE, "rotate arrow keys (0-3)" ); + osk_enable = Cvar_Get( "osk_enable", "0", FCVAR_ARCHIVE | FCVAR_LOCALONLY, "enable built-in on-screen keyboard" ); + key_rotate = Cvar_Get( "key_rotate", "0", FCVAR_ARCHIVE | FCVAR_LOCALONLY, "rotate arrow keys (0-3)" ); } diff --git a/engine/client/vid_common.c b/engine/client/vid_common.c index ae3a54e7..1f1d1a74 100644 --- a/engine/client/vid_common.c +++ b/engine/client/vid_common.c @@ -190,7 +190,7 @@ void VID_Init( void ) // a1ba: planned to be named vid_mode for compability // but supported mode list is filled by backends, so numbers are not portable any more - Cmd_AddCommand( "vid_setmode", VID_Mode_f, "display video mode" ); + Cmd_AddRestrictedCommand( "vid_setmode", VID_Mode_f, "display video mode" ); R_Init(); // init renderer } diff --git a/engine/common/common.h b/engine/common/common.h index c8800c57..e653e570 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -476,6 +476,7 @@ typedef void (*xcommand_t)( void ); void Cbuf_Init( void ); void Cbuf_Clear( void ); void Cbuf_AddText( const char *text ); +void Cbuf_AddFilteredText( const char *text ); void Cbuf_InsertText( const char *text ); void Cbuf_ExecStuffCmds( void ); void Cbuf_Execute (void); diff --git a/engine/common/cvar.c b/engine/common/cvar.c index d3bf0096..e19f3cc8 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -995,8 +995,8 @@ void Cvar_Init( void ) cmd_scripting = Cvar_Get( "cmd_scripting", "0", FCVAR_ARCHIVE, "enable simple condition checking and variable operations" ); Cvar_RegisterVariable (&host_developer); // early registering for dev - Cmd_AddCommand( "setgl", Cvar_SetGL_f, "change the value of a opengl variable" ); // OBSOLETE - Cmd_AddCommand( "toggle", Cvar_Toggle_f, "toggles a console variable's values (use for more info)" ); - Cmd_AddCommand( "reset", Cvar_Reset_f, "reset any type variable to initial value" ); + Cmd_AddRestrictedCommand( "setgl", Cvar_SetGL_f, "change the value of a opengl variable" ); // OBSOLETE + Cmd_AddRestrictedCommand( "toggle", Cvar_Toggle_f, "toggles a console variable's values (use for more info)" ); + Cmd_AddRestrictedCommand( "reset", Cvar_Reset_f, "reset any type variable to initial value" ); Cmd_AddCommand( "cvarlist", Cvar_List_f, "display all console variables beginning with the specified prefix" ); } diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index 3b8ac690..e15c6f1a 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -2061,9 +2061,9 @@ void FS_Init( void ) FS_InitMemory(); - Cmd_AddCommand( "fs_rescan", FS_Rescan_f, "rescan filesystem search pathes" ); - Cmd_AddCommand( "fs_path", FS_Path_f, "show filesystem search pathes" ); - Cmd_AddCommand( "fs_clearpaths", FS_ClearPaths_f, "clear filesystem search pathes" ); + Cmd_AddRestrictedCommand( "fs_rescan", FS_Rescan_f, "rescan filesystem search pathes" ); + Cmd_AddRestrictedCommand( "fs_path", FS_Path_f, "show filesystem search pathes" ); + Cmd_AddRestrictedCommand( "fs_clearpaths", FS_ClearPaths_f, "clear filesystem search pathes" ); #if !XASH_WIN32 if( Sys_CheckParm( "-casesensitive" ) ) diff --git a/engine/common/host.c b/engine/common/host.c index f194055e..0a73b7f1 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -989,9 +989,9 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha Sys_InitLog(); - Cmd_AddCommand( "exec", Host_Exec_f, "execute a script file" ); + Cmd_AddRestrictedCommand( "exec", Host_Exec_f, "execute a script file" ); Cmd_AddCommand( "memlist", Host_MemStats_f, "prints memory pool information" ); - Cmd_AddCommand( "userconfigd", Host_Userconfigd_f, "execute all scripts from userconfig.d" ); + Cmd_AddRestrictedCommand( "userconfigd", Host_Userconfigd_f, "execute all scripts from userconfig.d" ); FS_Init(); Image_Init(); @@ -1047,9 +1047,9 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa // init commands and vars if( host_developer.value >= DEV_EXTENDED ) { - Cmd_AddCommand ( "sys_error", Sys_Error_f, "just throw a fatal error to test shutdown procedures"); - Cmd_AddCommand ( "host_error", Host_Error_f, "just throw a host error to test shutdown procedures"); - Cmd_AddCommand ( "crash", Host_Crash_f, "a way to force a bus error for development reasons"); + Cmd_AddRestrictedCommand ( "sys_error", Sys_Error_f, "just throw a fatal error to test shutdown procedures"); + Cmd_AddRestrictedCommand ( "host_error", Host_Error_f, "just throw a host error to test shutdown procedures"); + Cmd_AddRestrictedCommand ( "crash", Host_Crash_f, "a way to force a bus error for development reasons"); } Cvar_RegisterVariable( &cl_filterstuffcmd ); @@ -1074,7 +1074,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa // allow to change game from the console if( pChangeGame != NULL ) { - Cmd_AddCommand( "game", Host_ChangeGame_f, "change game" ); + Cmd_AddRestrictedCommand( "game", Host_ChangeGame_f, "change game" ); Cvar_Get( "host_allow_changegame", "1", FCVAR_READ_ONLY, "allows to change games" ); } else @@ -1094,10 +1094,10 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa Wcon_InitConsoleCommands (); #endif - Cmd_AddCommand( "quit", Sys_Quit, "quit the game" ); - Cmd_AddCommand( "exit", Sys_Quit, "quit the game" ); + Cmd_AddRestrictedCommand( "quit", Sys_Quit, "quit the game" ); + Cmd_AddRestrictedCommand( "exit", Sys_Quit, "quit the game" ); } - else Cmd_AddCommand( "minimize", Host_Minimize_f, "minimize main window to tray" ); + else Cmd_AddRestrictedCommand( "minimize", Host_Minimize_f, "minimize main window to tray" ); host.errorframe = 0; diff --git a/engine/common/hpak.c b/engine/common/hpak.c index 2aa4ea4b..0da8e8a7 100644 --- a/engine/common/hpak.c +++ b/engine/common/hpak.c @@ -1077,10 +1077,10 @@ void HPAK_Validate_f( void ) void HPAK_Init( void ) { - Cmd_AddCommand( "hpklist", HPAK_List_f, "list all files in specified HPK-file" ); - Cmd_AddCommand( "hpkremove", HPAK_Remove_f, "remove specified file from HPK-file" ); - Cmd_AddCommand( "hpkval", HPAK_Validate_f, "validate specified HPK-file" ); - Cmd_AddCommand( "hpkextract", HPAK_Extract_f, "extract all lumps from specified HPK-file" ); + Cmd_AddRestrictedCommand( "hpklist", HPAK_List_f, "list all files in specified HPK-file" ); + Cmd_AddRestrictedCommand( "hpkremove", HPAK_Remove_f, "remove specified file from HPK-file" ); + Cmd_AddRestrictedCommand( "hpkval", HPAK_Validate_f, "validate specified HPK-file" ); + Cmd_AddRestrictedCommand( "hpkextract", HPAK_Extract_f, "extract all lumps from specified HPK-file" ); hpk_maxsize = Cvar_Get( "hpk_maxsize", "0", FCVAR_ARCHIVE, "set limit by size for all HPK-files ( 0 - unlimited )" ); gp_hpak_queue = NULL; diff --git a/engine/common/identification.c b/engine/common/identification.c index 872f38e1..cc5e50ba 100644 --- a/engine/common/identification.c +++ b/engine/common/identification.c @@ -614,10 +614,10 @@ void ID_Init( void ) byte md5[16]; int i; - Cmd_AddCommand( "bloomfilter", ID_BloomFilter_f, "print bloomfilter raw value of arguments set"); - Cmd_AddCommand( "verifyhex", ID_VerifyHEX_f, "check if id source seems to be fake" ); + Cmd_AddRestrictedCommand( "bloomfilter", ID_BloomFilter_f, "print bloomfilter raw value of arguments set"); + Cmd_AddRestrictedCommand( "verifyhex", ID_VerifyHEX_f, "check if id source seems to be fake" ); #if XASH_LINUX - Cmd_AddCommand( "testcpuinfo", ID_TestCPUInfo_f, "try read cpu serial" ); + Cmd_AddRestrictedCommand( "testcpuinfo", ID_TestCPUInfo_f, "try read cpu serial" ); #endif #if XASH_ANDROID && !XASH_DEDICATED diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index 896ff442..9aa6009a 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -2543,10 +2543,10 @@ void HTTP_Init( void ) http.first_file = http.last_file = NULL; - Cmd_AddCommand("http_download", &HTTP_Download_f, "add file to download queue"); - Cmd_AddCommand("http_skip", &HTTP_Skip_f, "skip current download server"); - Cmd_AddCommand("http_cancel", &HTTP_Cancel_f, "cancel current download"); - Cmd_AddCommand("http_clear", &HTTP_Clear_f, "cancel all downloads"); + Cmd_AddRestrictedCommand("http_download", &HTTP_Download_f, "add file to download queue"); + Cmd_AddRestrictedCommand("http_skip", &HTTP_Skip_f, "skip current download server"); + Cmd_AddRestrictedCommand("http_cancel", &HTTP_Cancel_f, "cancel current download"); + Cmd_AddRestrictedCommand("http_clear", &HTTP_Clear_f, "cancel all downloads"); Cmd_AddCommand("http_list", &HTTP_List_f, "list all queued downloads"); Cmd_AddCommand("http_addcustomserver", &HTTP_AddCustomServer_f, "add custom fastdl server"); http_useragent = Cvar_Get( "http_useragent", "xash3d", FCVAR_ARCHIVE, "User-Agent string" ); diff --git a/engine/platform/linux/in_evdev.c b/engine/platform/linux/in_evdev.c index 11a2ce43..638ceddb 100644 --- a/engine/platform/linux/in_evdev.c +++ b/engine/platform/linux/in_evdev.c @@ -449,9 +449,9 @@ void Platfrom_MouseMove( float *yaw, float *pitch ) void Evdev_Init( void ) { - Cmd_AddCommand ("evdev_open", Evdev_OpenDevice_f, "Open event device"); - Cmd_AddCommand ("evdev_close", Evdev_CloseDevice_f, "Close event device"); - Cmd_AddCommand ("evdev_autodetect", Evdev_Autodetect_f, "Automaticly open mouses and keyboards"); + Cmd_AddRestrictedCommand ("evdev_open", Evdev_OpenDevice_f, "Open event device"); + Cmd_AddRestrictedCommand ("evdev_close", Evdev_CloseDevice_f, "Close event device"); + Cmd_AddRestrictedCommand ("evdev_autodetect", Evdev_Autodetect_f, "Automaticly open mouses and keyboards"); #if XASH_INPUT == INPUT_EVDEV Evdev_Autodetect_f(); #endif diff --git a/engine/platform/linux/s_alsa.c b/engine/platform/linux/s_alsa.c index 4cddee95..5a694d39 100644 --- a/engine/platform/linux/s_alsa.c +++ b/engine/platform/linux/s_alsa.c @@ -66,7 +66,7 @@ qboolean SNDDMA_Init( void ) Sys_GetParmFromCmdLine( "-alsadev", device ); - Cmd_AddCommand("pcm_pause", SND_Pause_f, "set pcm pause (debug)" ); + Cmd_AddRestrictedCommand("pcm_pause", SND_Pause_f, "set pcm pause (debug)" ); if( ( err = snd_pcm_open( &s_alsa.pcm_handle, device, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK ) ) < 0) { diff --git a/engine/server/sv_cmds.c b/engine/server/sv_cmds.c index 58843bfc..4d216f0e 100644 --- a/engine/server/sv_cmds.c +++ b/engine/server/sv_cmds.c @@ -1002,19 +1002,19 @@ is available always */ void SV_InitHostCommands( void ) { - Cmd_AddCommand( "map", SV_Map_f, "start new level" ); + Cmd_AddRestrictedCommand( "map", SV_Map_f, "start new level" ); Cmd_AddCommand( "maps", SV_Maps_f, "list maps" ); if( host.type == HOST_NORMAL ) { - Cmd_AddCommand( "newgame", SV_NewGame_f, "begin new game" ); - Cmd_AddCommand( "hazardcourse", SV_HazardCourse_f, "starting a Hazard Course" ); - Cmd_AddCommand( "map_background", SV_MapBackground_f, "set background map" ); - Cmd_AddCommand( "load", SV_Load_f, "load a saved game file" ); - Cmd_AddCommand( "loadquick", SV_QuickLoad_f, "load a quick-saved game file" ); - Cmd_AddCommand( "reload", SV_Reload_f, "continue from latest save or restart level" ); - Cmd_AddCommand( "killsave", SV_DeleteSave_f, "delete a saved game file and saveshot" ); - Cmd_AddCommand( "nextmap", SV_NextMap_f, "load next level" ); + Cmd_AddRestrictedCommand( "newgame", SV_NewGame_f, "begin new game" ); + Cmd_AddRestrictedCommand( "hazardcourse", SV_HazardCourse_f, "starting a Hazard Course" ); + Cmd_AddRestrictedCommand( "map_background", SV_MapBackground_f, "set background map" ); + Cmd_AddRestrictedCommand( "load", SV_Load_f, "load a saved game file" ); + Cmd_AddRestrictedCommand( "loadquick", SV_QuickLoad_f, "load a quick-saved game file" ); + Cmd_AddRestrictedCommand( "reload", SV_Reload_f, "continue from latest save or restart level" ); + Cmd_AddRestrictedCommand( "killsave", SV_DeleteSave_f, "delete a saved game file and saveshot" ); + Cmd_AddRestrictedCommand( "nextmap", SV_NextMap_f, "load next level" ); } } diff --git a/engine/server/sv_filter.c b/engine/server/sv_filter.c index 22edf085..b36908b2 100644 --- a/engine/server/sv_filter.c +++ b/engine/server/sv_filter.c @@ -426,14 +426,14 @@ static void SV_WriteIP_f( void ) void SV_InitFilter( void ) { - Cmd_AddCommand( "banid", SV_BanID_f, "ban player by ID" ); - Cmd_AddCommand( "listid", SV_ListID_f, "list banned players" ); - Cmd_AddCommand( "removeid", SV_RemoveID_f, "remove player from banned list" ); - Cmd_AddCommand( "writeid", SV_WriteID_f, "write banned.cfg" ); - Cmd_AddCommand( "addip", SV_AddIP_f, "add entry to IP filter" ); - Cmd_AddCommand( "listip", SV_ListIP_f, "list current IP filter" ); - Cmd_AddCommand( "removeip", SV_RemoveIP_f, "remove IP filter" ); - Cmd_AddCommand( "writeip", SV_WriteIP_f, "write listip.cfg" ); + Cmd_AddRestrictedCommand( "banid", SV_BanID_f, "ban player by ID" ); + Cmd_AddRestrictedCommand( "listid", SV_ListID_f, "list banned players" ); + Cmd_AddRestrictedCommand( "removeid", SV_RemoveID_f, "remove player from banned list" ); + Cmd_AddRestrictedCommand( "writeid", SV_WriteID_f, "write banned.cfg" ); + Cmd_AddRestrictedCommand( "addip", SV_AddIP_f, "add entry to IP filter" ); + Cmd_AddRestrictedCommand( "listip", SV_ListIP_f, "list current IP filter" ); + Cmd_AddRestrictedCommand( "removeip", SV_RemoveIP_f, "remove IP filter" ); + Cmd_AddRestrictedCommand( "writeip", SV_WriteIP_f, "write listip.cfg" ); } void SV_ShutdownFilter( void )