Skip to content

Commit fc94759

Browse files
authored
Merge pull request #29521 from nextcloud/backport/29366/stable19
[stable19] Fix security issues when copying groupfolder with advanced ACL
2 parents fd71f49 + 5b7b972 commit fc94759

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/private/Files/Storage/Local.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,10 @@ private function calculateEtag(string $path, array $stat): string {
513513
* @return bool
514514
*/
515515
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
516-
if ($sourceStorage->instanceOfStorage(Local::class)) {
516+
// Don't treat ACLStorageWrapper like local storage where copy can be done directly.
517+
// Instead use the slower recursive copying in php from Common::copyFromStorage with
518+
// more permissions checks.
519+
if ($sourceStorage->instanceOfStorage(Local::class) && !$sourceStorage->instanceOfStorage('OCA\GroupFolders\ACL\ACLStorageWrapper')) {
517520
if ($sourceStorage->instanceOfStorage(Jail::class)) {
518521
/**
519522
* @var \OC\Files\Storage\Wrapper\Jail $sourceStorage

0 commit comments

Comments
 (0)