diff options
author | Robin Appelman <robin@icewind.nl> | 2025-01-03 17:41:39 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2025-01-06 14:45:35 +0100 |
commit | 757076af29469fe919c56dc043e54f33d71e8e2c (patch) | |
tree | f832e45b33ff5be80bc113da86edc29743b13b5b /lib | |
parent | 1cfef862071ba2e7ffc814dd8e106b65838548e5 (diff) | |
download | nextcloud-server-mount-move-checks.tar.gz nextcloud-server-mount-move-checks.zip |
fix: explicitly ignore nested mounts when transfering ownershipmount-move-checks
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-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 03bafd2e635..072d3520ae9 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -700,11 +700,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)); @@ -772,13 +775,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 */ |