diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 00:04:01 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 00:04:01 +0000 |
commit | 3f4a50f70dc37fde21637a15d83c302df172860a (patch) | |
tree | 19db6cbe97e3686cdd3aca55adc2b5c499b3d12d /ppapi | |
parent | 1c31e29c9a6f257ee3130fae93ae21968d71c881 (diff) | |
download | chromium_src-3f4a50f70dc37fde21637a15d83c302df172860a.zip chromium_src-3f4a50f70dc37fde21637a15d83c302df172860a.tar.gz chromium_src-3f4a50f70dc37fde21637a15d83c302df172860a.tar.bz2 |
Pepper: Use QuotaFileIO for SetLength, FileUtilProxy for Touch.
Now that FileIO is in the browser, we can use QuotaFileIO for SetLength and
FileUtilProxy for Touch.
Previously, we allowed SetLength without quota checks, and without even
opening the file with write access.
In order for Touch to succeed on Windows, we must set the
FILE_WRITE_ATTRIBUTES flag when we translate from Pepper open flags to
PlatformFile flags. Since the Pepper docs indicate that Touch should
succeed without write access, we always allow FILE_WRITE_ATTRIBUTES.
This should be OK since there is no way for untrusted apps to set
attributes other than file times.
BUG=313426
Review URL: https://codereview.chromium.org/79543003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/shared_impl/file_type_conversion.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ppapi/shared_impl/file_type_conversion.cc b/ppapi/shared_impl/file_type_conversion.cc index 917d196..1a4bb16 100644 --- a/ppapi/shared_impl/file_type_conversion.cc +++ b/ppapi/shared_impl/file_type_conversion.cc @@ -44,12 +44,13 @@ bool PepperFileOpenFlagsToPlatformFileFlags(int32_t pp_open_flags, bool pp_exclusive = !!(pp_open_flags & PP_FILEOPENFLAG_EXCLUSIVE); bool pp_append = !!(pp_open_flags & PP_FILEOPENFLAG_APPEND); - int flags = 0; + // Pepper allows Touch on any open file, so always set this Windows-only flag. + int flags = base::PLATFORM_FILE_WRITE_ATTRIBUTES; + if (pp_read) flags |= base::PLATFORM_FILE_READ; if (pp_write) { flags |= base::PLATFORM_FILE_WRITE; - flags |= base::PLATFORM_FILE_WRITE_ATTRIBUTES; } if (pp_append) { if (pp_write) |