aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-04-28 15:39:01 +0200
committerRobin Appelman <robin@icewind.nl>2024-03-06 17:52:24 +0100
commit4fba4cd14ce78e3e0af64a97485a02e47640a144 (patch)
treed82e8508af958ac1702c5cfa00eaa32f33df38e5 /lib/private
parentaf466a0d3ac20a2b459fcc2051525297633ea7e9 (diff)
downloadnextcloud-server-4fba4cd14ce78e3e0af64a97485a02e47640a144.tar.gz
nextcloud-server-4fba4cd14ce78e3e0af64a97485a02e47640a144.zip
fix: fix user folder init
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/Config/UserMountCache.php2
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php8
-rw-r--r--lib/private/Files/SetupManager.php6
3 files changed, 13 insertions, 3 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php
index 27d84e93838..13908c8725e 100644
--- a/lib/private/Files/Config/UserMountCache.php
+++ b/lib/private/Files/Config/UserMountCache.php
@@ -94,7 +94,7 @@ class UserMountCache implements IUserMountCache {
$cachedMounts = $this->getMountsForUser($user);
if (is_array($mountProviderClasses)) {
- $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts) {
+ $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts): bool {
// for existing mounts that didn't have a mount provider set
// we still want the ones that map to new mounts
if ($mountInfo->getMountProvider() === '' && isset($newMounts[$mountInfo->getKey()])) {
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index 7eb284fc774..3ef13f0ab01 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -82,6 +82,14 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
if (isset($params['validateWrites'])) {
$this->validateWrites = (bool)$params['validateWrites'];
}
+
+ // home storage is setup in the SetupManager
+ if (!$this instanceof HomeObjectStoreStorage) {
+ //initialize cache with root directory in cache
+ if (!$this->is_dir('/')) {
+ $this->mkdir('/');
+ }
+ }
$this->handleCopiesAsOwned = (bool)($params['handleCopiesAsOwned'] ?? false);
$this->logger = \OCP\Server::get(LoggerInterface::class);
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index db4debfb83f..accb071a814 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -257,8 +257,10 @@ class SetupManager {
if ($homeMount->getStorageRootId() === -1) {
$this->eventLogger->start('fs:setup:user:home:scan', 'Scan home filesystem for user');
- $homeMount->getStorage()->mkdir('');
- $homeMount->getStorage()->getScanner()->scan('');
+ $homeStorage = $homeMount->getStorage();
+ $homeStorage->mkdir('');
+ $homeStorage->mkdir('files');
+ $homeStorage->getScanner()->scan('');
$this->eventLogger->end('fs:setup:user:home:scan');
}