aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-01-03 17:41:39 +0100
committerAndy Scherzinger <info@andy-scherzinger.de>2025-02-05 09:09:04 +0100
commit5d094feee029be806424872eb9c31dd870466063 (patch)
treed96acaf2a9fff98a25665771e129bae254aec8d6 /lib
parent6cf97e929b7d2cdbce66240c985127f468e925cd (diff)
downloadnextcloud-server-5d094feee029be806424872eb9c31dd870466063.tar.gz
nextcloud-server-5d094feee029be806424872eb9c31dd870466063.zip
fix: explicitly ignore nested mounts when transfering ownership
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/View.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index f10c8a85f59..1f0d8d3ae03 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -693,11 +693,14 @@ class View {
*
* @param string $source source path
* @param string $target target path
+ * @param array $options
*
* @return bool|mixed
* @throws LockedException
*/
- public function rename($source, $target) {
+ public function rename($source, $target, array $options = []) {
+ $checkSubMounts = $options['checkSubMounts'] ?? true;
+
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($source));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($target));
@@ -765,13 +768,16 @@ class View {
try {
$this->changeLock($target, ILockingProvider::LOCK_EXCLUSIVE, true);
- $movedMounts = $mountManager->findIn($this->getAbsolutePath($source));
+ if ($checkSubMounts) {
+ $movedMounts = $mountManager->findIn($this->getAbsolutePath($source));
+ } else {
+ $movedMounts = [];
+ }
if ($internalPath1 === '') {
$sourceParentMount = $this->getMount(dirname($source));
$movedMounts[] = $mount1;
$this->validateMountMove($movedMounts, $sourceParentMount, $mount2, !$this->targetIsNotShared($targetUser, $absolutePath2));
-
/**
* @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1
*/