Don't set the +x bit by default on WriteFile().

This change is a spiritual successor of https://bazel-review.googlesource.com/c/7410/ . That one had a merge conflict and it was small enough that a rewrite was easier than updating it.

RELNOTES: None.
PiperOrigin-RevId: 160251282
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 38a92d9..310ce21 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -808,7 +808,7 @@
            path.c_str());
     }
 
-    if (!blaze_util::WriteFile(data, size, path)) {
+    if (!blaze_util::WriteFile(data, size, path, 0755)) {
       die(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
           "\nFailed to write zipped file \"%s\": %s", path.c_str(),
           blaze_util::GetLastErrorString().c_str());
diff --git a/src/main/cpp/util/file.h b/src/main/cpp/util/file.h
index 2292ec0..4bc1651 100644
--- a/src/main/cpp/util/file.h
+++ b/src/main/cpp/util/file.h
@@ -61,7 +61,7 @@
 // Writes `content` into file `filename`, and chmods it to `perm`.
 // Returns false on failure.
 bool WriteFile(const std::string &content, const std::string &filename,
-               unsigned int perm = 0755);
+               unsigned int perm = 0644);
 
 // Returns the part of the path before the final "/".  If there is a single
 // leading "/" in the path, the result will be the leading "/".  If there is
diff --git a/src/main/cpp/util/file_platform.h b/src/main/cpp/util/file_platform.h
index 31a0d1c..179eac3 100644
--- a/src/main/cpp/util/file_platform.h
+++ b/src/main/cpp/util/file_platform.h
@@ -97,7 +97,7 @@
 // Writes `size` bytes from `data` into file `filename` and chmods it to `perm`.
 // Returns false on failure, sets errno.
 bool WriteFile(const void *data, size_t size, const std::string &filename,
-               unsigned int perm = 0755);
+               unsigned int perm = 0644);
 
 // Result of a `WriteToStdOutErr` operation.
 //