Skip to content

Commit

Permalink
Merge pull request #45008 from nextcloud/backport/44892/stable25
Browse files Browse the repository at this point in the history
[stable25] fix(files): Also skip cross storage move with access control
  • Loading branch information
nickvergessen committed Apr 24, 2024
2 parents 4f6ba65 + 0ce5133 commit 35baf71
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 @@ -558,11 +558,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 35baf71

Please sign in to comment.