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

Unified Diff: chromeos/disks/disk_mount_manager.cc

Issue 2247263002: Prevent formatting a device being mounted in read-only mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert some more changes to preserve existing style. Created 4 years, 4 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
« no previous file with comments | « no previous file | chromeos/disks/disk_mount_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/disks/disk_mount_manager.cc
diff --git a/chromeos/disks/disk_mount_manager.cc b/chromeos/disks/disk_mount_manager.cc
index 869aa5c7555d276c4f91a19103002a9496f1b7fd..756920ac8c608f7de4a0309f2590d9458b9f811f 100644
--- a/chromeos/disks/disk_mount_manager.cc
+++ b/chromeos/disks/disk_mount_manager.cc
@@ -123,6 +123,12 @@ class DiskMountManagerImpl : public DiskMountManager {
OnFormatCompleted(FORMAT_ERROR_UNKNOWN, device_path);
return;
}
+ if (disk->second->is_read_only()) {
+ LOG(ERROR) << "Mount point with path \"" << mount_path
+ << "\" is read-only.";
+ OnFormatCompleted(FORMAT_ERROR_DEVICE_NOT_ALLOWED, mount_path);
+ return;
+ }
UnmountPath(disk->second->mount_path(),
UNMOUNT_OPTIONS_NONE,
« no previous file with comments | « no previous file | chromeos/disks/disk_mount_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698