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

Unified Diff: content/browser/fileapi/fileapi_message_filter.cc

Issue 23461031: FileAPIMessageFilter Security: Minimal patch to fix permissions escalation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
Index: content/browser/fileapi/fileapi_message_filter.cc
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
index b4b5aefc866fdaa0d599b4f093b8f8cf462f43fe..86d049a623c9bab4e8d2ab197eb4f806609813a4 100644
--- a/content/browser/fileapi/fileapi_message_filter.cc
+++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -442,8 +442,7 @@ void FileAPIMessageFilter::OnOpenFile(
int request_id, const GURL& path, int file_flags) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
base::PlatformFileError error;
- const int open_permissions = base::PLATFORM_FILE_OPEN |
- (file_flags & fileapi::kOpenFilePermissions);
+ const int open_permissions = file_flags & fileapi::kOpenPepperFilePermissions;
FileSystemURL url(context_->CrackURL(path));
if (!HasPermissionsForFile(url, open_permissions, &error)) {
Send(new FileSystemMsg_DidFail(request_id, error));
@@ -464,7 +463,7 @@ void FileAPIMessageFilter::OnOpenFile(
}
operations_[request_id] = operation_runner()->OpenFile(
- url, file_flags, PeerHandle(),
+ url, open_permissions, PeerHandle(),
base::Bind(&FileAPIMessageFilter::DidOpenFile, this, request_id,
quota_policy));
}

Powered by Google App Engine
This is Rietveld 408576698