Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Jan 2, 2024
1 parent 9aa90a0 commit ee5a5dd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,11 @@ private ImmutableList<BindMount> prepareAndGetBindMounts(
Path mountPoint = entry.getKey();
Path content = entry.getValue();
if (mountPoint.startsWith(tmpPath)) {
Preconditions.checkState(!mountPoint.equals(tmpPath));
// sandboxTmp should be null if /tmp is an explicit mount point since useHermeticTmp()
// returns false in that case.
if (mountPoint.equals(tmpPath)) {
throw new IOException("Cannot mount /tmp explicitly with hermetic /tmp");
}
// We need to rewrite the mount point to be under the sandbox tmp directory, which will be
// mounted onto /tmp as the final mount.
mountPoint = sandboxTmp.getRelative(mountPoint.relativeTo(tmpPath));
Expand Down

0 comments on commit ee5a5dd

Please sign in to comment.