Fix #2018: Can't access localhost in bazel 0.3.2.

The behavior of the Linux sandbox was changed to not hide the local hostname by default.

It is now only hidden when the --sandbox_fake_hostname flag is specified.

Also, instead of using the hostname "sandbox" in this case, it now uses "localhost", which fixes the issue of sandboxed processes not being able to resolve their local hostname.

RELNOTES: For increased compatibility with environments where UTS namespaces are not available, the Linux sandbox no longer hides the hostname of the local machine by default. Use --sandbox_fake_hostname to re-enable this feature.

--
PiperOrigin-RevId: 146244268
MOS_MIGRATED_REVID=146244268
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java
index 18df3d0..ce917f3 100644
--- a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxStrategy.java
@@ -78,7 +78,8 @@
           outErr,
           Spawns.getTimeoutSeconds(spawn),
           SandboxHelpers.shouldAllowNetwork(buildRequest, spawn),
-          sandboxOptions.sandboxDebug);
+          sandboxOptions.sandboxDebug,
+          sandboxOptions.sandboxFakeHostname);
     } catch (ExecException e) {
       execException = e;
     }