aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-08-20 13:32:03 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-08-20 14:18:16 +0000
commitc2af3e04b0c1fb1aba8d7087649a86aa3524211e (patch)
treef78e4df1b037b46d42aadf37e7b8e6487b3ec5be /lib
parent52da5f715f0be61ba82eccdbc9434abc7fce3e66 (diff)
downloadnextcloud-server-c2af3e04b0c1fb1aba8d7087649a86aa3524211e.tar.gz
nextcloud-server-c2af3e04b0c1fb1aba8d7087649a86aa3524211e.zip
fix: use mountpoint from storage to find the encryption keys
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index 499ba1f317f..c549e3a439a 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -44,6 +44,7 @@ use OC\Files\Cache\CacheEntry;
use OC\Files\Filesystem;
use OC\Files\Mount\Manager;
use OC\Files\ObjectStore\ObjectStoreStorage;
+use OC\Files\Storage\Common;
use OC\Files\Storage\LocalTempFileTrait;
use OC\Memcache\ArrayCache;
use OCP\Cache\CappedMemoryCache;
@@ -806,9 +807,8 @@ 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) {
- $mountPoint = $mount[0]->getMountPoint();
+ if ($sourceStorage->instanceOfStorage(Common::class) && $sourceStorage->getMountOption('mount_point')) {
+ $mountPoint = $sourceStorage->getMountOption('mount_point');
$source = $mountPoint . '/' . $sourceInternalPath;
$target = $this->getFullPath($targetInternalPath);
$this->copyKeys($source, $target);