Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore shared Collective mounts when scanning files #42497

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/private/Files/Utils/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use OC\ForbiddenException;
use OC\Hooks\PublicEmitter;
use OC\Lock\DBLockingProvider;
use OCA\Collectives\Mount\CollectiveStorage;
use OCA\Files_Sharing\SharedStorage;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Events\BeforeFileScannedEvent;
Expand Down Expand Up @@ -238,10 +239,11 @@
}
}

// don't scan received local shares, these can be scanned when scanning the owner's storage
if ($storage->instanceOfStorage(SharedStorage::class)) {
// don't scan received local shares or collectives, these can be scanned when scanning the owner's storage
if ($storage->instanceOfStorage(SharedStorage::class) || $storage->instanceOfStorage(CollectiveStorage::class)) {

Check failure on line 243 in lib/private/Files/Utils/Scanner.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UndefinedClass

lib/private/Files/Utils/Scanner.php:243:89: UndefinedClass: Class, interface or enum named OCA\Collectives\Mount\CollectiveStorage does not exist (see https://psalm.dev/019)

Check failure on line 243 in lib/private/Files/Utils/Scanner.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InvalidArgument

lib/private/Files/Utils/Scanner.php:243:89: InvalidArgument: Argument 1 of OC\Files\Storage\Storage::instanceOfStorage expects class-string<OCP\Files\Storage\IStorage>, but OCA\Collectives\Mount\CollectiveStorage::class provided (see https://psalm.dev/004)
skjnldsv marked this conversation as resolved.
Show resolved Hide resolved
Fixed Show fixed Hide fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Show resolved Hide resolved
continue;
}

$relativePath = $mount->getInternalPath($dir);
$scanner = $storage->getScanner();
$scanner->setUseTransactions(false);
Expand Down
Loading