mirror of
https://github.com/nextcloud/server.git
synced 2026-06-05 14:56:35 -04:00
Merge pull request #47353 from nextcloud/backport/47346/stable28
This commit is contained in:
commit
64dbca274d
2 changed files with 6 additions and 5 deletions
|
|
@ -120,8 +120,9 @@ class SetupManager {
|
|||
$prevLogging = Filesystem::logWarningWhenAddingStorageWrapper(false);
|
||||
|
||||
Filesystem::addStorageWrapper('mount_options', function ($mountPoint, IStorage $storage, IMountPoint $mount) {
|
||||
if ($mount->getOptions() && $storage->instanceOfStorage(Common::class)) {
|
||||
$storage->setMountOptions($mount->getOptions());
|
||||
if ($storage->instanceOfStorage(Common::class)) {
|
||||
$options = array_merge($mount->getOptions(), ['mount_point' => $mountPoint]);
|
||||
$storage->setMountOptions($options);
|
||||
}
|
||||
return $storage;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue