diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxRunner.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxRunner.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxRunner.java b/src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxRunner.java index c8387581ff..06f9244ddd 100644 --- a/src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxRunner.java +++ b/src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxRunner.java @@ -14,6 +14,8 @@ package com.google.devtools.build.lib.sandbox; +import static java.nio.charset.StandardCharsets.UTF_8; + import com.google.common.collect.ImmutableMap; import com.google.common.io.ByteStreams; import com.google.devtools.build.lib.shell.Command; @@ -22,8 +24,10 @@ import com.google.devtools.build.lib.shell.KillableObserver; import com.google.devtools.build.lib.shell.TimeoutKillableObserver; import com.google.devtools.build.lib.util.OS; import com.google.devtools.build.lib.vfs.Path; +import java.io.BufferedWriter; import java.io.File; import java.io.IOException; +import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; @@ -50,7 +54,7 @@ final class DarwinSandboxRunner extends SandboxRunner { Set<Path> inaccessiblePaths, Path runUnderPath, boolean verboseFailures) { - super(sandboxExecRoot, verboseFailures); + super(verboseFailures); this.sandboxExecRoot = sandboxExecRoot; this.argumentsFilePath = sandboxPath.getRelative("sandbox.sb"); this.writableDirs = writableDirs; @@ -117,7 +121,10 @@ final class DarwinSandboxRunner extends SandboxRunner { } private void writeConfig(boolean allowNetwork) throws IOException { - try (PrintWriter out = new PrintWriter(argumentsFilePath.getOutputStream())) { + try (PrintWriter out = + new PrintWriter( + new BufferedWriter( + new OutputStreamWriter(argumentsFilePath.getOutputStream(), UTF_8)))) { // Note: In Apple's sandbox configuration language, the *last* matching rule wins. out.println("(version 1)"); out.println("(debug deny)"); |