]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(encryption): Fix mountpoint check to accept if several are found 47118/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 5 Aug 2024 15:34:25 +0000 (17:34 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 7 Aug 2024 18:59:42 +0000 (18:59 +0000)
There is no strong requirement to have only one mount for a given
 storage id. Also the error in this case would be misleading.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/Files/Storage/Wrapper/Encryption.php

index 7ce4338256f0168357caa8e1972652fbf7da7111..499ba1f317f2c5e55149f5cd7813fffef5005e36 100644 (file)
@@ -807,7 +807,7 @@ class Encryption extends Wrapper {
                // first copy the keys that we reuse the existing file key on the target location
                // and don't create a new one which would break versions for example.
                $mount = $this->mountManager->findByStorageId($sourceStorage->getId());
-               if (count($mount) === 1) {
+               if (count($mount) >= 1) {
                        $mountPoint = $mount[0]->getMountPoint();
                        $source = $mountPoint . '/' . $sourceInternalPath;
                        $target = $this->getFullPath($targetInternalPath);