Skip to content

Commit 82161e2

Browse files
committed
Merged PR 716979: Lazily initialize ptracerunner exe variable only when ptrace sandbox is enabled
- Fixes a break in anybuild where the ptracerunner is not deployed because they don't use the ptrace sandbox.
1 parent b31aff1 commit 82161e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Public/Src/Engine/Processes/SandboxedProcessUnix.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static string GetStdInFilePath(string workingDirectory, long pipSemiStabl
121121
/// <summary>
122122
/// Path to the ptrace runner to be used if the ptrace sandbox is enabled.
123123
/// </summary>
124-
internal static readonly string PTraceRunnerExecutable = EnsureDeploymentFile(SandboxConnectionLinuxDetours.PTraceRunnerFileName, setExecuteBit: true);
124+
internal static readonly Lazy<string> PTraceRunnerExecutable = new(() => EnsureDeploymentFile(SandboxConnectionLinuxDetours.PTraceRunnerFileName, setExecuteBit: true));
125125

126126
internal static string GetDeploymentFileFullPath(string relativePath)
127127
{
@@ -1070,13 +1070,13 @@ private void StartPTraceRunner(int pid, string path)
10701070
var args = $"-c {pid} -x {path}";
10711071
var process = new System.Diagnostics.Process
10721072
{
1073-
StartInfo = new System.Diagnostics.ProcessStartInfo(PTraceRunnerExecutable, args)
1073+
StartInfo = new System.Diagnostics.ProcessStartInfo(PTraceRunnerExecutable.Value, args)
10741074
{
10751075
CreateNoWindow = true,
10761076
UseShellExecute = false,
10771077
RedirectStandardError = true,
10781078
RedirectStandardOutput = true,
1079-
WorkingDirectory = Path.GetDirectoryName(PTraceRunnerExecutable)
1079+
WorkingDirectory = Path.GetDirectoryName(PTraceRunnerExecutable.Value)
10801080
},
10811081
EnableRaisingEvents = true
10821082
};

0 commit comments

Comments
 (0)