Skip to content

Commit

Permalink
fix: don't do same-storage move optimization with encryption wrappers
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Nov 13, 2024
1 parent 22e2419 commit 0bc478d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use OC\Files\FilenameValidator;
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\Cache\ICache;
Expand Down Expand Up @@ -546,7 +547,10 @@ private function isSameStorage(IStorage $storage): bool {
}

public function moveFromStorage(IStorage $sourceStorage, string $sourceInternalPath, string $targetInternalPath): bool {
if ($this->isSameStorage($sourceStorage)) {
if (
!$sourceStorage->instanceOfStorage(Encryption::class) &&
$this->isSameStorage($sourceStorage)
) {
// resolve any jailed paths
while ($sourceStorage->instanceOfStorage(Jail::class)) {
/**
Expand Down

0 comments on commit 0bc478d

Please sign in to comment.