From bb3e6ea9d915de56938c801f2e390fbe5c88d506 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 13 Nov 2024 18:47:13 +0100 Subject: [PATCH] fix: don't do same-storage move optimization with encryption wrappers Signed-off-by: Robin Appelman --- lib/private/Files/Storage/Common.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index cff19e33dcef0..003bf9900ee92 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -50,6 +50,7 @@ use OC\Files\Cache\Watcher; use OC\Files\Filesystem; use OC\Files\ObjectStore\ObjectStoreStorage; +use OC\Files\Storage\Wrapper\Encryption; use OC\Files\Storage\Wrapper\Jail; use OC\Files\Storage\Wrapper\Wrapper; use OCP\Files\EmptyFileNameException; @@ -687,7 +688,10 @@ private function isSameStorage(IStorage $storage): bool { * @return bool */ public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { - if ($this->isSameStorage($sourceStorage)) { + if ( + !$sourceStorage->instanceOfStorage(Encryption::class) && + $this->isSameStorage($sourceStorage) + ) { // resolve any jailed paths while ($sourceStorage->instanceOfStorage(Jail::class)) { /**