From 67b047eead4caf147401f33545a142fa146025f2 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 15 Sep 2023 16:03:41 +0100 Subject: [PATCH] [*] UNIX Processes: fix overmap regression in (d166a00d) and added support for envblock updates missing in (d166a00d) --- Source/Processes/AuProcess.Unix.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Source/Processes/AuProcess.Unix.cpp b/Source/Processes/AuProcess.Unix.cpp index 1ff30dbc..45511926 100644 --- a/Source/Processes/AuProcess.Unix.cpp +++ b/Source/Processes/AuProcess.Unix.cpp @@ -481,8 +481,35 @@ namespace Aurora::Processes } #endif - ::setsid(); + if (this->type_ != ESpawnType::eSpawnOvermap) + { + ::setsid(); + } + + if (!this->startup_.bInheritEnvironmentVariables) + { + try + { + AuList keys; + + for (const auto &[key, value] : AuProcess::EnvironmentGetAll()) + { + keys.push_back(key); + } + AuProcess::EnvironmentRemoveMany(keys); + } + catch (...) + { + SysPanic("Couldn't fork"); + } + } + + if (this->startup_.environmentVariables.size()) + { + SysAssert(AuProcess::EnvironmentSetMany(this->startup_.environmentVariables)); + } + #if defined(AURORA_IS_XNU_DERIVED) if (this->startup_.workingDirectory) {