]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(encryption): Fix mountpoint check to accept if several are found 47119/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 19:01:35 +0000 (19:01 +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 e68e1f65048dae50ab916db44f0877c4b1c23326..bce4674caed29f48d793eb3ba30960d61977fe65 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);