diff options
author | tbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 20:09:39 +0000 |
---|---|---|
committer | tbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 20:09:39 +0000 |
commit | f11d90d4c520273afd2344d7e3ed67499e159424 (patch) | |
tree | 3096db18af7d9a0c5033c11bedc5d9cf8a2a7bd8 /base/platform_file_posix.cc | |
parent | 25f23ffa4e529c8b3040faa03989d588191cab8b (diff) | |
download | chromium_src-f11d90d4c520273afd2344d7e3ed67499e159424.zip chromium_src-f11d90d4c520273afd2344d7e3ed67499e159424.tar.gz chromium_src-f11d90d4c520273afd2344d7e3ed67499e159424.tar.bz2 |
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
Diffstat (limited to 'base/platform_file_posix.cc')
-rw-r--r-- | base/platform_file_posix.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc index b138a67..1f50cfe 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; } |