From 9476ce70ed326304afeb9b5aab3a412b4f1acaaa Mon Sep 17 00:00:00 2001 From: Christian Paier Date: Sat, 5 Feb 2022 23:26:55 +0100 Subject: [PATCH] Removes misleading error message in occ files:scan for new users. Previously the occ files:scan command printed an error message for any new users without any files/folders in the data directory. With this change only users with any file/folder is scanned. This fixes #25433. Signed-off-by: Christian Paier --- lib/private/Files/Utils/Scanner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index 2e5a25a355b..5b633617608 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -216,7 +216,7 @@ class Scanner extends PublicEmitter { if ($storage->instanceOfStorage('\OC\Files\Storage\Home') and (!$storage->isCreatable('') or !$storage->isCreatable('files')) ) { - if ($storage->file_exists('') or $storage->getCache()->inCache('')) { + if ($storage->is_dir('files')) { throw new ForbiddenException(); } else {// if the root exists in neither the cache nor the storage the user isn't setup yet break;