]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: use mountpoint from storage to find the encryption keys 47346/head
authorRobin Appelman <robin@icewind.nl>
Tue, 20 Aug 2024 11:32:03 +0000 (13:32 +0200)
committerRobin Appelman <robin@icewind.nl>
Tue, 20 Aug 2024 11:32:03 +0000 (13:32 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Storage/Wrapper/Encryption.php

index 7d45c356bfed0936e5d1e98c5c97983660f092cb..09048c239eecedc1918a3e07c7eef76b9c83fb55 100644 (file)
@@ -14,6 +14,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;
@@ -776,9 +777,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);