Skip to content

Commit

Permalink
Merge pull request #45009 from nextcloud/backport/44892/stable24
Browse files Browse the repository at this point in the history
[stable24] fix(files): Also skip cross storage move with access control
  • Loading branch information
nickvergessen authored Apr 24, 2024
2 parents bf5792a + dbff2d5 commit af11616
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 @@ -540,11 +540,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 af11616

Please sign in to comment.