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

Unified Diff: base/files/file_util_posix.cc

Issue 1396613004: Use permissions 0666 on POSIX platforms except Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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/files/file_util_posix.cc
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
index ffa79a45f42d64c933801895c918134f3502dc77..77f93ffd531571a49f3620e02853885ec952021b 100644
--- a/base/files/file_util_posix.cc
+++ b/base/files/file_util_posix.cc
@@ -674,7 +674,12 @@ int ReadFile(const FilePath& filename, char* data, int max_size) {
int WriteFile(const FilePath& filename, const char* data, int size) {
ThreadRestrictions::AssertIOAllowed();
- int fd = HANDLE_EINTR(creat(filename.value().c_str(), 0640));
+#if !defined(OS_ANDROID)
Lei Zhang 2015/10/13 08:46:40 nit: how about being positive with if-else defines
hashimoto 2015/10/14 03:18:14 Acknowledged.
+ const mode_t mode = 0666;
+#else
+ const mode_t mode = 0640; // Be strict on Android. crbug.com/362887
+#endif
+ int fd = HANDLE_EINTR(creat(filename.value().c_str(), mode));
if (fd < 0)
return -1;
« 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