Skip to content

Commit

Permalink
Merge pull request #5757 from nextcloud/mount-rename-12
Browse files Browse the repository at this point in the history
[12]  Fix renaming of non-renamble mounts
  • Loading branch information
MorrisJobke authored Jul 21, 2017
2 parents c6e3368 + 8bfa392 commit 816f1e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
5 changes: 2 additions & 3 deletions core/js/files/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
20 changes: 12 additions & 8 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -779,14 +779,18 @@ public function rename($path1, $path2) {
$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;
}
Expand Down

0 comments on commit 816f1e6

Please sign in to comment.