From 2b22aa3f6b613bb07eee8384f61d3c9d578aeb32 Mon Sep 17 00:00:00 2001 From: thfr Date: Sat, 16 Oct 2021 14:43:12 +0000 Subject: [PATCH] update to 0.34; also disable dangerous 'localcommand' functionality (see discussion in GitHub PR #69); from maintainer Tom Murphy - thanks! --- games/mvdsv/Makefile | 4 +- games/mvdsv/distinfo | 4 +- games/mvdsv/patches/patch-src_server_h | 26 +++++++++ games/mvdsv/patches/patch-src_sv_ccmds_c | 73 ++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 games/mvdsv/patches/patch-src_server_h create mode 100644 games/mvdsv/patches/patch-src_sv_ccmds_c diff --git a/games/mvdsv/Makefile b/games/mvdsv/Makefile index b7c11a84aaf..b54eb9cda66 100644 --- a/games/mvdsv/Makefile +++ b/games/mvdsv/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.3 2020/12/22 20:53:25 solene Exp $ +# $OpenBSD: Makefile,v 1.4 2021/10/16 14:43:12 thfr Exp $ COMMENT = QuakeWorld server GH_ACCOUNT = deurk GH_PROJECT = mvdsv -GH_TAGNAME = 0.33 +GH_TAGNAME = 0.34 CATEGORIES = games diff --git a/games/mvdsv/distinfo b/games/mvdsv/distinfo index ec8d3c28fa7..a56cdaf2d72 100644 --- a/games/mvdsv/distinfo +++ b/games/mvdsv/distinfo @@ -1,4 +1,4 @@ -SHA256 (mvdsv-0.33.tar.gz) = 3Jq9u+B2Wdbtx/8LyIA08eWSihZPe6mq+Shpkw4uQYQ= +SHA256 (mvdsv-0.34.tar.gz) = gZBxjf4QiPTxKmYXfusBwaUn9fRl5w3sT7uP7tSZTGo= SHA256 (qwprogs-20120131.dat) = /1HLXnc2DXK5NIfYkZjc+UYpuS+LrhAPxupIpsEqeDA= -SIZE (mvdsv-0.33.tar.gz) = 576306 +SIZE (mvdsv-0.34.tar.gz) = 597476 SIZE (qwprogs-20120131.dat) = 197684 diff --git a/games/mvdsv/patches/patch-src_server_h b/games/mvdsv/patches/patch-src_server_h new file mode 100644 index 00000000000..177c9fa8178 --- /dev/null +++ b/games/mvdsv/patches/patch-src_server_h @@ -0,0 +1,26 @@ +$OpenBSD: patch-src_server_h,v 1.1 2021/10/16 14:43:12 thfr Exp $ + +Remove dangerous localcommand function even if it it not turned on +by default and needs a command-line option. There is a pull request +at: https://github.com/deurk/mvdsv/pull/69 + + +Index: src/server.h +--- src/server.h.orig ++++ src/server.h +@@ -1087,7 +1087,6 @@ void SV_SetClientConnectionTime(client_t* client); + #ifdef SERVERONLY + // mvdsv not changed over to enums yet, which was more about documentation + #define SV_CommandLineEnableCheats() (COM_CheckParm("-cheats")) +-#define SV_CommandLineEnableLocalCommand() (COM_CheckParm("-enablelocalcommand")) + #define SV_CommandLineDemoCacheArgument() (COM_CheckParm("-democache")) + #define SV_CommandLineProgTypeArgument() (COM_CheckParm("-progtype")) + #define SV_CommandLineUseMinimumMemory() (COM_CheckParm("-minmemory")) +@@ -1095,7 +1094,6 @@ void SV_SetClientConnectionTime(client_t* client); + #define SV_CommandLineHeapSizeMemoryMB() (COM_CheckParm("-mem")) + #else + #define SV_CommandLineEnableCheats() (COM_CheckParm(cmdline_param_server_enablecheats)) +-#define SV_CommandLineEnableLocalCommand() (COM_CheckParm(cmdline_param_server_enablelocalcommand)) + #define SV_CommandLineDemoCacheArgument() (COM_CheckParm(cmdline_param_server_democache_kb)) + #define SV_CommandLineProgTypeArgument() (COM_CheckParm(cmdline_param_server_progtype)) + #define SV_CommandLineUseMinimumMemory() (COM_CheckParm(cmdline_param_host_memory_minimum)) diff --git a/games/mvdsv/patches/patch-src_sv_ccmds_c b/games/mvdsv/patches/patch-src_sv_ccmds_c new file mode 100644 index 00000000000..9ca842e85ba --- /dev/null +++ b/games/mvdsv/patches/patch-src_sv_ccmds_c @@ -0,0 +1,73 @@ +$OpenBSD: patch-src_sv_ccmds_c,v 1.1 2021/10/16 14:43:12 thfr Exp $ + +Remove dangerous localcommand function even if it it not turned on +by default and needs a command-line option. There is a pull request +at: https://github.com/deurk/mvdsv/pull/69 + +Index: src/sv_ccmds.c +--- src/sv_ccmds.c.orig ++++ src/sv_ccmds.c +@@ -738,54 +738,6 @@ void SV_ChmodFile_f (void) + } + #endif //_WIN32 + +-/*================== +-SV_LocalCommand_f +-Execute system command +-==================*/ +-//bliP: REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME -> +-void SV_LocalCommand_f (void) +-{ +- int i, c; +- char str[1024], *temp_file = "__output_temp_file__"; +- +- if ((c = Cmd_Argc()) < 2) +- { +- Con_Printf("localcommand [command]\n"); +- return; +- } +- +- str[0] = 0; +- for (i = 1; i < c; i++) +- { +- strlcat (str, Cmd_Argv(i), sizeof(str)); +- strlcat (str, " ", sizeof(str)); +- } +- strlcat (str, va("> %s 2>&1\n", temp_file), sizeof(str)); +- +- if (system(str) == -1) +- Con_Printf("command failed\n"); +- else +- { +- char buf[512]; +- FILE *f; +- if ((f = fopen(temp_file, "rt")) == NULL) +- Con_Printf("(empty)\n"); +- else +- { +- while (!feof(f)) +- { +- buf[fread (buf, 1, sizeof(buf) - 1, f)] = 0; +- Con_Printf("%s", buf); +- } +- fclose(f); +- if (Sys_remove(temp_file)) +- Con_Printf("Unable to remove file %s\n", temp_file); +- } +- } +- +-} +-//REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME +- + /* + ================== + SV_Kick_f +@@ -1844,8 +1796,6 @@ void SV_InitOperatorCommands (void) + Cmd_AddCommand ("chmod", SV_ChmodFile_f); + #endif //_WIN32 + //<- +- if (SV_CommandLineEnableLocalCommand()) +- Cmd_AddCommand ("localcommand", SV_LocalCommand_f); + + Cmd_AddCommand ("map", SV_Map_f); + #ifdef SERVERONLY