Merge pull request #44889 from nextcloud/bugfix/noid/skip-cross-storage-move-with-ac

fix(files): Also skip cross storage move with access control
This commit is contained in:
Joas Schilling 2024-04-18 10:48:03 +02:00 committed by GitHub
commit 5fffbcfe86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -584,11 +584,14 @@ class Local extends \OC\Files\Storage\Common {
}
private function canDoCrossStorageMove(IStorage $sourceStorage) {
/** @psalm-suppress UndefinedClass */
return $sourceStorage->instanceOfStorage(Local::class)
// Don't treat ACLStorageWrapper like local storage where copy can be done directly.
// Instead, use the slower recursive copying in php from Common::copyFromStorage with
// more permissions checks.
&& !$sourceStorage->instanceOfStorage('OCA\GroupFolders\ACL\ACLStorageWrapper')
// Same for access control
&& !$sourceStorage->instanceOfStorage(\OCA\FilesAccessControl\StorageWrapper::class)
// when moving encrypted files we have to handle keys and the target might not be encrypted
&& !$sourceStorage->instanceOfStorage(Encryption::class);
}