فهرست منبع

fix(security): download linuxgsm.download files over HTTPS (#5070)

Switch the md5-pinned linuxgsm.download tarballs from http:// to https://.
fn_dl_hash already aborts on a checksum mismatch, so this is
defence-in-depth and consistency with #5054, not a vulnerability fix.
fn_fetch_file adds --proto-redir "=https" for https URLs, so a downloaded
file cannot be redirected back to http.
Daniel Gibbs 2 روز پیش
والد
کامیت
931509fe77
3فایلهای تغییر یافته به همراه27 افزوده شده و 27 حذف شده
  1. 1 1
      lgsm/modules/fix_bf1942.sh
  2. 1 1
      lgsm/modules/fix_bfv.sh
  3. 25 25
      lgsm/modules/install_server_files.sh

+ 1 - 1
lgsm/modules/fix_bf1942.sh

@@ -14,7 +14,7 @@ if ldd "${executabledir}/bf1942_lnxded.static" 2>&1 | grep -qE "lib(ncurses|tinf
 	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
 	fixname="libncurses5 i386"
 	fn_fix_msg_start_nl
-	fn_fetch_file "http://linuxgsm.download/libraries/libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "" "" "" "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "nochmodx" "norun" "noforce" "ee141cb3a843e4201786b6f188347666"
+	fn_fetch_file "https://linuxgsm.download/libraries/libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "" "" "" "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "nochmodx" "norun" "noforce" "ee141cb3a843e4201786b6f188347666"
 	fn_dl_extract "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "${serverfiles}"
 	fn_clear_tmp
 	fn_fix_msg_end

+ 1 - 1
lgsm/modules/fix_bfv.sh

@@ -14,7 +14,7 @@ if ldd "${executabledir}/bfv_linded.static" 2>&1 | grep -qE "lib(ncurses|tinfo)\
 	# shellcheck disable=SC2034 # Used by fn_fix_msg_start_nl and fn_fix_msg_end.
 	fixname="libncurses5 i386"
 	fn_fix_msg_start_nl
-	fn_fetch_file "http://linuxgsm.download/libraries/libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "" "" "" "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "nochmodx" "norun" "noforce" "ee141cb3a843e4201786b6f188347666"
+	fn_fetch_file "https://linuxgsm.download/libraries/libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "" "" "" "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "nochmodx" "norun" "noforce" "ee141cb3a843e4201786b6f188347666"
 	fn_dl_extract "${tmpdir}" "libncurses5-i386-6.3-2ubuntu0.3.tar.xz" "${serverfiles}"
 	fn_clear_tmp
 	fn_fix_msg_end

+ 25 - 25
lgsm/modules/install_server_files.sh

@@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_install_server_files() {
 	if [ "${shortname}" == "ahl" ]; then
-		remote_fileurl="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz"
+		remote_fileurl="https://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="action_halflife-1.0.tar.xz"
 		chmodx="nochmodx"
@@ -17,7 +17,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="61d7b79fd714888b6d65944fdaafa94a"
 	elif [ "${shortname}" == "bf1942" ]; then
-		remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full-linuxgsm.tar.xz"
+		remote_fileurl="https://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full-linuxgsm.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full-linuxgsm.tar.xz"
 		chmodx="nochmodx"
@@ -25,7 +25,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="d58016b3c45f86a71bb56c39749ce941"
 	elif [ "${shortname}" == "bfv" ]; then
-		remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch-linuxgsm.tar.xz"
+		remote_fileurl="https://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch-linuxgsm.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="bfv_linded-v1.21-20041207_patch-linuxgsm.tar.xz"
 		chmodx="nochmodx"
@@ -34,7 +34,7 @@ fn_install_server_files() {
 		md5="9a8117732b8abd99cc59f1f0fa92adfa"
 
 	elif [ "${shortname}" == "cod" ]; then
-		remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"
+		remote_fileurl="https://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="cod-lnxded-1.5-large.tar.xz"
 		chmodx="nochmodx"
@@ -42,7 +42,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f"
 	elif [ "${shortname}" == "coduo" ]; then
-		remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz"
+		remote_fileurl="https://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="coduo-lnxded-1.51b-full.tar.xz"
 		chmodx="nochmodx"
@@ -50,7 +50,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="35cabccd67adcda44aaebc59405915b9"
 	elif [ "${shortname}" == "cod2" ]; then
-		remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz"
+		remote_fileurl="https://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="cod2-lnxded-1.3-full.tar.xz"
 		chmodx="nochmodx"
@@ -58,7 +58,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="b8c4c611f01627dd43348e78478a3d41"
 	elif [ "${shortname}" == "cod4" ]; then
-		remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_lnxded.tar.xz"
+		remote_fileurl="https://linuxgsm.download/CallOfDuty4/cod4x18_lnxded.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="cod4x18_lnxded.tar.xz"
 		chmodx="nochmodx"
@@ -66,7 +66,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="d255b59b9756d7dbead67718208512ee"
 	elif [ "${shortname}" == "codwaw" ]; then
-		remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"
+		remote_fileurl="https://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="codwaw-lnxded-1.7-full.tar.xz"
 		chmodx="nochmodx"
@@ -74,7 +74,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="2c6be1bb66ea631b9b2e7ae6216c6680"
 	elif [ "${shortname}" == "mohaa" ]; then
-		remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"
+		remote_fileurl="https://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"
 		chmodx="nochmodx"
@@ -82,7 +82,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="7c664538999252eeaf2b6d9949416480"
 	elif [ "${shortname}" == "ns" ]; then
-		remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz"
+		remote_fileurl="https://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="ns_dedicated_server_v32.tar.xz"
 		chmodx="nochmodx"
@@ -90,7 +90,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="23ec3cadd93d8bb1c475bad5b9cce370"
 	elif [ "${shortname}" == "q2" ]; then
-		remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz"
+		remote_fileurl="https://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz"
 		chmodx="nochmodx"
@@ -98,7 +98,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="2908164a32d4808bb720f2161f6b0c82"
 	elif [ "${shortname}" == "q3" ]; then
-		remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz"
+		remote_fileurl="https://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="quake3-1.32c-x86-full-linux.tar.xz"
 		chmodx="nochmodx"
@@ -106,7 +106,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="b0e26d8919fe9313fb9d8ded2360f3db"
 	elif [ "${shortname}" == "q4" ]; then
-		remote_fileurl="http://linuxgsm.download/Quake4/quake4-1.4.2-x86-linuxded.tar.xz"
+		remote_fileurl="https://linuxgsm.download/Quake4/quake4-1.4.2-x86-linuxded.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="quake4-1.4.2-x86-linuxded.tar.xz"
 		chmodx="nochmodx"
@@ -114,7 +114,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="afe30b44f23c8ae2ce6f0f464473d8ba"
 	elif [ "${shortname}" == "qw" ]; then
-		remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"
+		remote_fileurl="https://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="nquake.server.linux.190506.full.tar.xz"
 		chmodx="nochmodx"
@@ -122,7 +122,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="82055b7d973206c13a606db8ba288d03"
 	elif [ "${shortname}" == "rtcw" ]; then
-		remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"
+		remote_fileurl="https://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"
 		chmodx="nochmodx"
@@ -130,7 +130,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="df6ff664d37dd0d22787848bdb3cac5f"
 	elif [ "${shortname}" == "sfc" ]; then
-		remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz"
+		remote_fileurl="https://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="SFClassic-1.0-RC7-fix.tar.xz"
 		chmodx="nochmodx"
@@ -138,7 +138,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="70077137185700e28fe6bbb6021d12bc"
 	elif [ "${shortname}" == "sof2" ]; then
-		remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz"
+		remote_fileurl="https://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="sof2gold-1.03.tar.xz"
 		chmodx="nochmodx"
@@ -146,7 +146,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="201e23bab04207d00ce813d001c483d9"
 	elif [ "${shortname}" == "ts" ]; then
-		remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz"
+		remote_fileurl="https://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="ts-3-linux-final.tar.xz"
 		chmodx="nochmodx"
@@ -154,7 +154,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="3c66ecff6e3644f7ac88015732a0fb93"
 	elif [ "${shortname}" == "ut2k4" ]; then
-		remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"
+		remote_fileurl="https://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"
 		chmodx="nochmodx"
@@ -162,7 +162,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="9fceaab68554749f4b45be66613b9a15"
 	elif [ "${shortname}" == "ut99" ]; then
-		remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz"
+		remote_fileurl="https://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="ut99-server-469b-ultimate-linux.tar.xz"
 		chmodx="nochmodx"
@@ -170,7 +170,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="dba3f1122a5e60ee45ece7422fcf78f5"
 	elif [ "${shortname}" == "ut" ]; then
-		remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"
+		remote_fileurl="https://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz"
 		chmodx="noexecute"
@@ -178,7 +178,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="41dd92015713a78211eaccf503b72393"
 	elif [ "${shortname}" == "ut3" ]; then
-		remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1-openspy.tar.xz"
+		remote_fileurl="https://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1-openspy.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="UT3-linux-server-2.1-openspy.tar.xz"
 		chmodx="nochmodx"
@@ -186,7 +186,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="f60b745613a8676666eb6a2450cbdc8e"
 	elif [ "${shortname}" == "vs" ]; then
-		remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz"
+		remote_fileurl="https://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="vs_l-6.0_full.tar.xz"
 		chmodx="nochmodx"
@@ -194,7 +194,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="b322f79e0abd31847493c52acf802667"
 	elif [ "${shortname}" == "wet" ]; then
-		remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz"
+		remote_fileurl="https://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="enemy-territory.260b.tar.xz"
 		chmodx="nochmodx"
@@ -210,7 +210,7 @@ fn_install_server_files() {
 		force="noforce"
 		md5="93705e165550c97484678236749198a4"
 	elif [ "${shortname}" == "zmr" ]; then
-		remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b6_1.tar.xz"
+		remote_fileurl="https://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b6_1.tar.xz"
 		local_filedir="${tmpdir}"
 		local_filename="zombie_master_reborn_b6_1.tar.xz"
 		chmodx="nochmodx"