non movable mounts can not be moved

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-07-03 14:58:34 +02:00
parent 125767265d
commit 0e107bc63c
No known key found for this signature in database
GPG Key ID: CBCA68FBAEBF98C9
1 changed files with 12 additions and 8 deletions

View File

@ -779,14 +779,18 @@ class View {
$this->changeLock($path1, ILockingProvider::LOCK_EXCLUSIVE, true);
$this->changeLock($path2, ILockingProvider::LOCK_EXCLUSIVE, true);
if ($internalPath1 === '' and $mount1 instanceof MoveableMount) {
if ($this->isTargetAllowed($absolutePath2)) {
/**
* @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1
*/
$sourceMountPoint = $mount1->getMountPoint();
$result = $mount1->moveMount($absolutePath2);
$manager->moveMount($sourceMountPoint, $mount1->getMountPoint());
if ($internalPath1 === '') {
if ($mount1 instanceof MoveableMount) {
if ($this->isTargetAllowed($absolutePath2)) {
/**
* @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1
*/
$sourceMountPoint = $mount1->getMountPoint();
$result = $mount1->moveMount($absolutePath2);
$manager->moveMount($sourceMountPoint, $mount1->getMountPoint());
} else {
$result = false;
}
} else {
$result = false;
}