From f3407ba973e20989470a20f179c779fff3e40eb1 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 2 Nov 2016 19:53:23 +0100 Subject: [PATCH] Transfer ownership only analyze home storage When transferring ownership, only the local files will be transferred during the rename operation. This means that the analyzing code doesn't need to recurse into any mount points. Furthermore this fixes issues where FailedStorage might appear as mount points as a result of inaccessible external storages or shares. So this makes it more robust. --- apps/files/command/transferownership.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/files/command/transferownership.php b/apps/files/command/transferownership.php index 1f46efdde0d8..8cc0d2f95465 100644 --- a/apps/files/command/transferownership.php +++ b/apps/files/command/transferownership.php @@ -148,6 +148,11 @@ protected function analyse(OutputInterface $output) { $this->walkFiles($view, "$this->sourceUser/files", function (FileInfo $fileInfo) use ($progress, $self) { if ($fileInfo->getType() === FileInfo::TYPE_FOLDER) { + // only analyze into folders from main storage, + // sub-storages have an empty internal path + if ($fileInfo->getInternalPath() === '' && $fileInfo->getPath() !== '') { + return false; + } return true; } $progress->advance();