This commit is contained in:
prixod
2025-12-01 22:29:25 +04:00
parent 5ed5925a38
commit f5cb2c8e2e
4 changed files with 69 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Collections.Generic;
using LiquidCode.Tester.Worker.Services.Isolate;
namespace LiquidCode.Tester.Worker.Services;
@@ -78,7 +79,20 @@ public class KotlinExecutionServiceIsolate : IExecutionService
EnableNetwork = false,
StdinFile = sandboxInputPath,
StdoutFile = outputFilePath,
WorkingDirectory = "/box"
WorkingDirectory = "/box",
DirectoryBindings = new List<DirectoryBinding>
{
new DirectoryBinding { HostPath = "/usr/lib", SandboxPath = "/usr/lib", ReadOnly = true },
new DirectoryBinding { HostPath = "/lib", SandboxPath = "/lib", ReadOnly = true },
new DirectoryBinding { HostPath = "/lib64", SandboxPath = "/lib64", ReadOnly = true },
new DirectoryBinding { HostPath = "/usr/bin", SandboxPath = "/usr/bin", ReadOnly = true },
new DirectoryBinding { HostPath = "/bin", SandboxPath = "/bin", ReadOnly = true },
new DirectoryBinding { HostPath = "/etc", SandboxPath = "/etc", ReadOnly = true }
},
EnvironmentVariables = new Dictionary<string, string>
{
["PATH"] = "/usr/local/bin:/usr/bin:/bin"
}
});
stopwatch.Stop();