summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-21 23:27:31 +0000
committertbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-21 23:27:31 +0000
commit32b047585d1e7217650b24fe92cd41ce04c5e0fd (patch)
tree9a4eba60dea0101ea0f4fbac191856e37b8fa908
parent21e28e1798c07d20217d6086caac1922671f4626 (diff)
downloadchromium_src-32b047585d1e7217650b24fe92cd41ce04c5e0fd.zip
chromium_src-32b047585d1e7217650b24fe92cd41ce04c5e0fd.tar.gz
chromium_src-32b047585d1e7217650b24fe92cd41ce04c5e0fd.tar.bz2
Merge 110740 - Create files readable by grp and oth in base::PlatformFile for posix.
Main motivation for this is webkit's createFile. While creating files with permission 0600 is not an issue on other platforms, on ChromeOs FileBrowser may access external filesystem, so it makes sense to create files with permission 0644. Further more creating files with mode 0600 on ChromeOS external fielsystem may cause some problems with zip file support (see bug). Note this is M16 release blocker... BUG=chromium-os:22263 TEST=linux_chromeos trybots verified copying files in FileBrowser on ChromeOs creates files with permission 644 Review URL: http://codereview.chromium.org/8590020 TBR=tbarzic@chromium.org Review URL: http://codereview.chromium.org/8620005 git-svn-id: svn://svn.chromium.org/chrome/branches/912/src@111037 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/platform_file_posix.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc
index 3c17c16..3b126bc 100644
--- a/base/platform_file_posix.cc
+++ b/base/platform_file_posix.cc
@@ -81,8 +81,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) {
@@ -92,7 +97,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;
}