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

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/open_file.cc

Issue 427493002: [fsp] Do not allow write operations on read only file systems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: chrome/browser/chromeos/file_system_provider/operations/open_file.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/open_file.cc b/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
index 8a1a3617f8e4d4d721a4899ed9ee88085cfccc13..93c930f4fed32c957e8e0ac228247df1eb89cc0f 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
@@ -29,6 +29,11 @@ OpenFile::~OpenFile() {
}
bool OpenFile::Execute(int request_id) {
+ if (!file_system_info_.writable() &&
+ mode_ == ProvidedFileSystemInterface::OPEN_FILE_MODE_WRITE) {
+ return false;
+ }
+
scoped_ptr<base::DictionaryValue> values(new base::DictionaryValue);
values->SetString("filePath", file_path_.AsUTF8Unsafe());

Powered by Google App Engine
This is Rietveld 408576698