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:
San Mehat
2010-02-24 08:54:18 -08:00
parent 9ff1f96fdf
commit 85451ee15f
2 changed files with 10 additions and 3 deletions

View File

@@ -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;
}
}