From nobody Mon Sep 12 17:02:54 2022 X-Original-To: dev-commits-ports-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MRCb2464nz4blcV; Mon, 12 Sep 2022 17:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MRCb23dHNz3J1Z; Mon, 12 Sep 2022 17:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663002174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9anscHURvhHzMnM66R0x5b+9ccd/NpXDSDTXYCLfh2U=; b=aYxHe5BxunNqcQxaWmmNe9s2a2UrHD/Pruqu46CAfklgGBwHoN1HYmBAY5H0NwR+timTNc cbu6g2CgR7PE2+d6ooHtKgT1KR/qbOcOeTcjuDy3quAij6pwsklM/UFIs6HFrZA1oM0s9s 7Hh9wxI7Mx9XWR8f9OwZBMVjtuTzFy22Damri/IP0dujrxnwkDGXX6D6WD6C6r9y4Dut0c MVNRQ2NZiuAlaxDrVfIFhiXDsV9t3FVfwO5ESliB6t1CyZuZ8E1rAkjTdBN3m1S/t5hUpR NN9aiXX44JGRe4QBCT8RBoGaIwOdpSNAqTB68q4JN4qfR2fuYnXif3/sqobrSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MRCb22k2cz13Hx; Mon, 12 Sep 2022 17:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28CH2sU4014238; Mon, 12 Sep 2022 17:02:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28CH2saL014237; Mon, 12 Sep 2022 17:02:54 GMT (envelope-from git) Date: Mon, 12 Sep 2022 17:02:54 GMT Message-Id: <202209121702.28CH2saL014237@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Neel Chauhan Subject: git: 9b5d73efd1eb - 2022Q3 - games/openarena: Fix crashing bug when downloading maps from the server List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-branches@freebsd.org X-BeenThere: dev-commits-ports-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: ports X-Git-Refname: refs/heads/2022Q3 X-Git-Reftype: branch X-Git-Commit: 9b5d73efd1eb88d6555f12d4e92cbf9f1aa81766 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663002174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9anscHURvhHzMnM66R0x5b+9ccd/NpXDSDTXYCLfh2U=; b=fzo6MGp0SnY/cebxmYn677qpdTmp+gttil9UjsvU267ZikXbuKoDkItQULD5BsR5rSxOqC zUaxHb1cPwNT6bXNkORwbIfNO0rLegziwDUvd7fQi+zOdE6CyfCpE4AcMv0ywih/+UiHCP BWrszgxxRadey5Avb++rRpwa28o0gkTzY12HhJa77TSf00E0lXbLQx/A9eEjaqXgNl5nUV nBnMdoXlCTt88uu7wp2EPhJ2X/Ttt8kr+O19/Aiimqc1o+GIT/3NR6n2hsho7IFZOk7kt9 bgiaajYLn2Zl6QjJIa2s1qW3ckAH5Y/N+CFMJMKxWDPurPvZlzSm7yy8Wc52Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663002174; a=rsa-sha256; cv=none; b=fag3dhUYwcDHEGN/AFn2LiKU6yxGLkVu277WbRzS8gcEIfOf1VsTCMUEIR2YK/FonRpNfA Z+DI/kwOf9370ahWuIAQ9mNsBi9xB09KjTL42NxV9dO29y2LnfId2MYn5/+zOuqCfUy0ku 8ArQW5SclRQAL/T8QP5cdUjZo4EZ/MzrGzNZspJA+MbJiPVl4Q9v/S0s6PJi4FmtKsIYD7 hOIWvsaD4vWlTOUsHdNnVAx53FFnFJbaAF0XeLw2RuHTvGplIsrwr7HlgolIrGJrcSOsnK fcruFL6vNczhDF+24rXoNNqkmZxNyRJtdLBIjuBjcOaqh3HFDiL7wqTQdDYb2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch 2022Q3 has been updated by nc: URL: https://cgit.FreeBSD.org/ports/commit/?id=9b5d73efd1eb88d6555f12d4e92cbf9f1aa81766 commit 9b5d73efd1eb88d6555f12d4e92cbf9f1aa81766 Author: Neel Chauhan AuthorDate: 2022-09-12 17:00:58 +0000 Commit: Neel Chauhan CommitDate: 2022-09-12 17:02:51 +0000 games/openarena: Fix crashing bug when downloading maps from the server PR: 266384 MFH: 2022Q3 (bugfix blanket) Reported by: Kaminar (cherry picked from commit 3b4d9afddf15b9e5872a9ef5d94592ebff063cd4) --- games/openarena/Makefile | 1 + .../files/patch-code_client_snd__openal.c | 8 ++--- games/openarena/files/patch-code_qcommon_files.c | 40 ++++++++++------------ games/openarena/files/patch-code_qcommon_qcommon.h | 10 +++--- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/games/openarena/Makefile b/games/openarena/Makefile index c1095157ca97..b2d64e11e6e9 100644 --- a/games/openarena/Makefile +++ b/games/openarena/Makefile @@ -2,6 +2,7 @@ PORTNAME= openarena PORTVERSION= ${GAMEVERSION}.s${SVNREVISION} +PORTREVISION= 1 PORTEPOCH= 2 MASTER_SITES= SF/oarena/src \ http://files.poulsander.com/~poul19/public_files/oa/dev088/ diff --git a/games/openarena/files/patch-code_client_snd__openal.c b/games/openarena/files/patch-code_client_snd__openal.c index 136e269b1de7..930229586f23 100644 --- a/games/openarena/files/patch-code_client_snd__openal.c +++ b/games/openarena/files/patch-code_client_snd__openal.c @@ -9,16 +9,16 @@ #endif /* -@@ -2358,6 +2358,12 @@ qboolean S_AL_Init( soundInterface_t *si +@@ -2357,6 +2357,12 @@ qboolean S_AL_Init( soundInterface_t *si ) + s_alDriver = Cvar_Get( "s_alDriver", ALDRIVER_DEFAULT, CVAR_ARCHIVE | CVAR_LATCH ); s_alDevice = Cvar_Get("s_alDevice", "", CVAR_ARCHIVE | CVAR_LATCH); - ++ + if ( COM_CompareExtension( s_alDriver->string, ".pk3" ) ) + { + Com_Printf( S_COLOR_RED "Rejecting s_alDriver named \"%s\"\n", s_alDriver->string ); + return qfalse; + } -+ + // Load QAL if( !QAL_Init( s_alDriver->string ) ) - { diff --git a/games/openarena/files/patch-code_qcommon_files.c b/games/openarena/files/patch-code_qcommon_files.c index b35962d7c3e1..e1cebd665482 100644 --- a/games/openarena/files/patch-code_qcommon_files.c +++ b/games/openarena/files/patch-code_qcommon_files.c @@ -1,6 +1,6 @@ --- code/qcommon/files.c.orig 2011-12-24 12:29:32 UTC +++ code/qcommon/files.c -@@ -195,6 +195,9 @@ static const unsigned int missionpak_che +@@ -195,6 +195,9 @@ static const unsigned int missionpak_checksums[] = 1438664554u }; @@ -10,7 +10,7 @@ // if this is defined, the executable positively won't work with any paks other // than the demo pak, even if productid is present. This is only used for our // last demo release to prevent the mac and linux users from using the demo -@@ -250,6 +253,7 @@ static cvar_t *fs_apppath; +@@ -250,6 +253,7 @@ static cvar_t *fs_basepath; #endif static cvar_t *fs_basepath; @@ -59,7 +59,7 @@ remove( osPath ); } -@@ -564,7 +570,7 @@ FS_HomeRemove +@@ -564,7 +570,7 @@ void FS_HomeRemove( const char *homePath ) { =========== */ void FS_HomeRemove( const char *homePath ) { @@ -68,7 +68,7 @@ remove( FS_BuildOSPath( fs_homepath->string, fs_gamedir, homePath ) ); -@@ -643,7 +649,7 @@ fileHandle_t FS_SV_FOpenFileWrite( const +@@ -643,7 +649,7 @@ fileHandle_t FS_SV_FOpenFileWrite( const char *filenam Com_Printf( "FS_SV_FOpenFileWrite: %s\n", ospath ); } @@ -86,20 +86,18 @@ char *from_ospath, *to_ospath; if ( !fs_searchpaths ) { -@@ -754,7 +760,11 @@ void FS_SV_Rename( const char *from, con +@@ -754,7 +760,9 @@ void FS_SV_Rename( const char *from, const char *to ) Com_Printf( "FS_SV_Rename: %s --> %s\n", from_ospath, to_ospath ); } - FS_CheckFilenameIsNotExecutable( to_ospath, __func__ ); -+ FS_CheckFilenameIsMutable( to_ospath, __func__ ); -+ + if ( safe ) { + FS_CheckFilenameIsMutable( to_ospath, __func__ ); + } rename(from_ospath, to_ospath); } -@@ -784,7 +794,7 @@ void FS_Rename( const char *from, const +@@ -784,7 +792,7 @@ void FS_Rename( const char *from, const char *to ) { Com_Printf( "FS_Rename: %s --> %s\n", from_ospath, to_ospath ); } @@ -108,7 +106,7 @@ rename(from_ospath, to_ospath); } -@@ -843,7 +853,7 @@ fileHandle_t FS_FOpenFileWrite( const ch +@@ -843,7 +851,7 @@ fileHandle_t FS_FOpenFileWrite( const char *filename ) Com_Printf( "FS_FOpenFileWrite: %s\n", ospath ); } @@ -117,7 +115,7 @@ if( FS_CreatePath( ospath ) ) { return 0; -@@ -891,7 +901,7 @@ fileHandle_t FS_FOpenFileAppend( const c +@@ -891,7 +899,7 @@ fileHandle_t FS_FOpenFileAppend( const char *filename Com_Printf( "FS_FOpenFileAppend: %s\n", ospath ); } @@ -126,7 +124,7 @@ if( FS_CreatePath( ospath ) ) { return 0; -@@ -963,6 +973,7 @@ int FS_FOpenFileRead( const char *filena +@@ -963,6 +971,7 @@ int FS_FOpenFileRead( const char *filename, fileHandle FILE *temp; int l; char demoExt[16]; @@ -134,7 +132,7 @@ hash = 0; -@@ -970,11 +981,22 @@ int FS_FOpenFileRead( const char *filena +@@ -970,11 +979,22 @@ int FS_FOpenFileRead( const char *filename, fileHandle Com_Error( ERR_FATAL, "Filesystem call made without initialization\n" ); } @@ -157,7 +155,7 @@ hash = FS_HashFileName(filename, search->pack->hashSize); } // is the element a pak file? -@@ -1040,6 +1062,14 @@ int FS_FOpenFileRead( const char *filena +@@ -1040,6 +1060,14 @@ int FS_FOpenFileRead( const char *filename, fileHandle for ( search = fs_searchpaths ; search ; search = search->next ) { // if ( search->pack ) { @@ -172,7 +170,7 @@ hash = FS_HashFileName(filename, search->pack->hashSize); } // is the element a pak file? -@@ -1657,7 +1687,7 @@ Creates a new pak_t in the search chain +@@ -1657,7 +1685,7 @@ of a zip file. of a zip file. ================= */ @@ -181,7 +179,7 @@ { fileInPack_t *buildBuffer; pack_t *pack; -@@ -1666,11 +1696,12 @@ static pack_t *FS_LoadZipFile(const char +@@ -1666,11 +1694,12 @@ static pack_t *FS_LoadZipFile(const char *zipfile, con unz_global_info gi; char filename_inzip[MAX_ZPATH]; unz_file_info file_info; @@ -195,7 +193,7 @@ fs_numHeaderLongs = 0; -@@ -1714,6 +1745,7 @@ static pack_t *FS_LoadZipFile(const char +@@ -1714,6 +1743,7 @@ static pack_t *FS_LoadZipFile(const char *zipfile, con Q_strncpyz( pack->pakFilename, zipfile, sizeof( pack->pakFilename ) ); Q_strncpyz( pack->pakBasename, basename, sizeof( pack->pakBasename ) ); @@ -203,7 +201,7 @@ // strip .pk3 if needed if ( strlen( pack->pakBasename ) > 4 && !Q_stricmp( pack->pakBasename + strlen( pack->pakBasename ) - 4, ".pk3" ) ) { -@@ -1730,6 +1762,30 @@ static pack_t *FS_LoadZipFile(const char +@@ -1730,6 +1760,30 @@ static pack_t *FS_LoadZipFile(const char *zipfile, con if (err != UNZ_OK) { break; } @@ -234,7 +232,7 @@ if (file_info.uncompressed_size > 0) { fs_headerLongs[fs_numHeaderLongs++] = LittleLong(file_info.crc); } -@@ -1784,7 +1840,7 @@ qboolean FS_CompareZipChecksum(const cha +@@ -1784,7 +1838,7 @@ qboolean FS_CompareZipChecksum(const char *zipfile) pack_t *thepak; int index, checksum; @@ -243,7 +241,7 @@ if(!thepak) return qfalse; -@@ -2569,10 +2625,8 @@ void FS_AddGameDirectory( const char *pa +@@ -2569,10 +2623,8 @@ void FS_AddGameDirectory( const char *path, const char for ( i = 0 ; i < numfiles ; i++ ) { pakfile = FS_BuildOSPath( path, dir, pakfiles[i] ); @@ -255,7 +253,7 @@ fs_packFiles += pak->numfiles; -@@ -2854,11 +2908,14 @@ static void FS_Startup( const char *game +@@ -2854,11 +2906,14 @@ static void FS_Startup( const char *gameName ) Com_Printf( "----- FS_Startup -----\n" ); @@ -270,7 +268,7 @@ homePath = Sys_DefaultHomePath(); if (!homePath || !homePath[0]) { homePath = fs_basepath->string; -@@ -2878,6 +2935,11 @@ static void FS_Startup( const char *game +@@ -2878,6 +2933,11 @@ static void FS_Startup( const char *gameName ) if (fs_apppath->string[0]) FS_AddGameDirectory(fs_apppath->string, gameName); #endif diff --git a/games/openarena/files/patch-code_qcommon_qcommon.h b/games/openarena/files/patch-code_qcommon_qcommon.h index 80bca4095d6a..56b32faea469 100644 --- a/games/openarena/files/patch-code_qcommon_qcommon.h +++ b/games/openarena/files/patch-code_qcommon_qcommon.h @@ -13,7 +13,7 @@ // referenced flags // these are in loop specific order so don't change the order #define FS_GENERAL_REF 0x01 -@@ -627,7 +633,7 @@ fileHandle_t FS_FOpenFileAppend( const c +@@ -627,7 +633,7 @@ int FS_SV_FOpenFileRead( const char *filename, fileHa fileHandle_t FS_SV_FOpenFileWrite( const char *filename ); int FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp ); @@ -22,13 +22,13 @@ int FS_FOpenFileRead( const char *qpath, fileHandle_t *file, qboolean uniqueFILE ); // if uniqueFILE is true, then a new FILE will be fopened even if the file // is found in an already open pak file. If uniqueFILE is false, you must call -@@ -1099,6 +1105,9 @@ char *Sys_DefaultInstallPath(void); +@@ -1098,6 +1104,9 @@ char *Sys_DefaultAppPath(void); + #ifdef MACOS_X char *Sys_DefaultAppPath(void); #endif - ++ +void Sys_SetDefaultLibPath(const char *path); +char *Sys_DefaultLibPath(void); -+ + void Sys_SetDefaultHomePath(const char *path); char *Sys_DefaultHomePath(void); - const char *Sys_TempPath(void);