Skip to content

Commit

Permalink
Merge pull request #44892 from nextcloud/backport/44889/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(files): Also skip cross storage move with access control
  • Loading branch information
nickvergessen authored Apr 18, 2024
2 parents 02d680c + 7203ce2 commit cb376a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,14 @@ private function calculateEtag(string $path, array $stat): string {
}

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);
}
Expand Down

0 comments on commit cb376a6

Please sign in to comment.