[Posix] Respect umask settings for directories

Calling mkdir with 700 will always set group and other settings
to none. Calling it with 777 will cause mkdir to use the default
(umask) settings.

Bug: 279
Change-Id: Ibdc7970edc354e1593f741a5b4cb8a66feb0b9e7
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/13120
Reviewed-by: Roland McGrath <mcgrathr@google.com>
Reviewed-by: Petr Hosek <phosek@google.com>
Commit-Queue: Roland McGrath <mcgrathr@google.com>
diff --git a/src/base/files/file_util_posix.cc b/src/base/files/file_util_posix.cc
index ac281c4..aa54731 100644
--- a/src/base/files/file_util_posix.cc
+++ b/src/base/files/file_util_posix.cc
@@ -444,7 +444,7 @@
        i != subpaths.rend(); ++i) {
     if (DirectoryExists(*i))
       continue;
-    if (mkdir(i->value().c_str(), 0700) == 0)
+    if (mkdir(i->value().c_str(), 0777) == 0)
       continue;
     // Mkdir failed, but it might have failed with EEXIST, or some other error
     // due to the the directory appearing out of thin air. This can occur if