diff options
author | Philipp Wollermann <philwo@google.com> | 2016-03-21 17:17:52 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-03-21 18:39:27 +0000 |
commit | 1fe0e97f337956a208957be69e97d710870203e1 (patch) | |
tree | 1364473c0f32547f0099437ed1399a63f26d52fd /src/main/java/com/google/devtools/build/lib | |
parent | 56d24a78bfd5bc53cfaf3b4242c17c9167e2b8d3 (diff) |
Fix #1063: When a temporary file was created in /etc while we were globbing the list of files to mount, but was deleted by the time the namespace-sandbox actually mounted the files, it would crash with a "file not found" error.
--
MOS_MIGRATED_REVID=117726198
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java b/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java index 69ed5666a7..ce775591b5 100644 --- a/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java @@ -309,17 +309,13 @@ public class LinuxSandboxedStrategy implements SpawnActionContext { FileSystem fs = blazeDirs.getFileSystem(); mounts.put(fs.getPath("/bin"), fs.getPath("/bin")); mounts.put(fs.getPath("/sbin"), fs.getPath("/sbin")); + mounts.put(fs.getPath("/etc"), fs.getPath("/etc")); // Check if /etc/resolv.conf is a symlink and mount its target // Fix #738 Path resolv = fs.getPath("/etc/resolv.conf"); if (resolv.exists() && resolv.isSymbolicLink()) { - mounts.put(resolv, resolv.resolveSymbolicLinks()); - - List<Path> resolvList = ImmutableList.of(resolv); - mounts.putAll(mountDirExclude(fs.getPath("/etc"), resolvList)); - } else { - mounts.put(fs.getPath("/etc"), fs.getPath("/etc")); + mounts.put(resolv.resolveSymbolicLinks(), resolv.resolveSymbolicLinks()); } for (String entry : NativePosixFiles.readdir("/")) { |