MountService: Fix bug which would allow apps to try to rename a container whos dst is mounted
Signed-off-by: San Mehat <san@google.com>
This commit is contained in:
@@ -1003,7 +1003,11 @@ class MountService extends IMountService.Stub
|
||||
warnOnNotMounted();
|
||||
|
||||
synchronized (mAsecMountSet) {
|
||||
if (mAsecMountSet.contains(oldId)) {
|
||||
/*
|
||||
* Because a mounted container has active internal state which cannot be
|
||||
* changed while active, we must ensure both ids are not currently mounted.
|
||||
*/
|
||||
if (mAsecMountSet.contains(oldId) || mAsecMountSet.contains(newId)) {
|
||||
return StorageResultCode.OperationFailedStorageMounted;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user