Commit f11d90d4 authored by tbarzic@chromium.org's avatar tbarzic@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110740 0039d316-1c4b-4281-b951-d872f2087c98
parent 25f23ffa
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment