diff options
author | Robin Appelman <robin@icewind.nl> | 2025-01-03 17:41:39 +0100 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2025-02-05 09:39:28 +0100 |
commit | 804a0ec56752bdcc36569d27f24e9217b680748e (patch) | |
tree | 4c15c709ae0536540302197f54b59f480983623a /lib/private | |
parent | 7a37fdddc53457ac49fec4292b08839fefbdd9f7 (diff) | |
download | nextcloud-server-804a0ec56752bdcc36569d27f24e9217b680748e.tar.gz nextcloud-server-804a0ec56752bdcc36569d27f24e9217b680748e.zip |
fix: explicitly ignore nested mounts when transfering ownership
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/View.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 864dc8745b9..2a6bc507d00 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -732,11 +732,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)); @@ -800,13 +803,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 */ |