Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: base/platform_file_posix.cc

Issue 8590020: Make files created in base::PlatformFile readable by grp and oth on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file_posix.cc
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc
index b138a67c7d694df4c067b3cb35a4799f88cdfad9..1f50cfe06208aa1b16317a6792cfaf8513a6e7c1 100644
--- a/base/platform_file_posix.cc
+++ b/base/platform_file_posix.cc
@@ -80,8 +80,13 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags,
COMPILE_ASSERT(O_RDONLY == 0, O_RDONLY_must_equal_zero);
+ int mode = S_IRUSR | S_IWUSR;
+#if defined(OS_CHROMEOS)
+ mode |= S_IRGRP | S_IROTH;
+#endif
+
int descriptor =
- HANDLE_EINTR(open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR));
+ HANDLE_EINTR(open(name.value().c_str(), open_flags, mode));
if (flags & PLATFORM_FILE_OPEN_ALWAYS) {
if (descriptor <= 0) {
@@ -91,7 +96,7 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags,
open_flags |= O_EXCL; // together with O_CREAT implies O_NOFOLLOW
}
descriptor = HANDLE_EINTR(
- open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR));
+ open(name.value().c_str(), open_flags, mode));
if (created && descriptor > 0)
*created = true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698