Merge pull request #5757 from nextcloud/mount-rename-12

[12]  Fix renaming of non-renamble mounts
This commit is contained in:
Morris Jobke 2017-07-21 23:30:42 +02:00 committed by GitHub
commit 816f1e63e9
2 changed files with 14 additions and 11 deletions

View File

@ -338,11 +338,10 @@
case 'C':
case 'K':
data.permissions |= OC.PERMISSION_CREATE;
if (!isFile) {
data.permissions |= OC.PERMISSION_UPDATE;
}
break;
case 'W':
case 'N':
case 'V':
data.permissions |= OC.PERMISSION_UPDATE;
break;
case 'D':

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