From e4f9a6b0549c2457a6957bf892b2ef9f9a9f4e97 Mon Sep 17 00:00:00 2001 From: MotoLegacy Date: Sun, 24 Nov 2024 17:10:43 -0800 Subject: [PATCH] QC_PathRequiresSandbox: Allow writing to `scripts/` --- engine/common/pr_bgcmd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index cc6a1b264..19c065c89 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -2571,10 +2571,18 @@ static qboolean QC_PathRequiresSandbox(const char *name) huds\*.cfg (shouldn't have any passwords. yay editing) models\*.* (xonotic is evil) sound\*.* (xonotic is evil) + + *=*= NZ:P EDIT: We need write access to scripts\ directory. Sorry, spike! *=*= */ + // NZ:P START + if (!strnicmp(name, "scripts/", 8)) + return false; + // NZ:P END + if ((!strchr(name, '/') || !strnicmp(name, "configs/", 8)) // && !stricmp(COM_GetFileExtension(name, NULL), ".cfg")) return true; + return false; } @@ -2603,7 +2611,7 @@ qboolean QC_FixFileName(const char *name, const char **result, const char **fall *fallbackread = NULL; //don't be weird. *result = name; //already has a data/ prefix. } - else if (COM_CheckParm("-unsafefopen") && !QC_PathRequiresSandbox(name)) + else if (!QC_PathRequiresSandbox(name)) { *fallbackread = va("data/%s", name); //in case the mod was distributed with a data/ subdir. *result = name;