Skip to content

Commit f319a04

Browse files
committed
fix user folder init
Signed-off-by: Robin Appelman <[email protected]>
1 parent 1d7ddcf commit f319a04

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

lib/private/Files/Config/UserMountCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function registerMounts(IUser $user, array $mounts, array $mountProviderC
9393
if (is_array($mountProviderClasses)) {
9494
$cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use (
9595
$mountProviderClasses
96-
) {
96+
): bool {
9797
return in_array($mountInfo->getMountProvider(), $mountProviderClasses);
9898
});
9999
}
@@ -131,7 +131,7 @@ public function registerMounts(IUser $user, array $mounts, array $mountProviderC
131131
$this->removeFromCache($mount);
132132
foreach ($mountsForUsers as $index => $mountForUser) {
133133
/** @var ICachedMountInfo $mountForUser */
134-
if ($mount->getRootId() == $mountForUser->getRootId() && $mount->getMountPoint() == $mountForUser->getMountPoint()) {
134+
if ($mount->getRootId() === $mountForUser->getRootId() && $mount->getMountPoint() === $mountForUser->getMountPoint()) {
135135
unset($mountsForUsers[$index]);
136136
break;
137137
}

lib/private/Files/ObjectStore/ObjectStoreStorage.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,13 @@ public function __construct($params) {
7575
if (isset($params['objectPrefix'])) {
7676
$this->objectPrefix = $params['objectPrefix'];
7777
}
78-
//initialize cache with root directory in cache
79-
if (!$this->is_dir('/')) {
80-
$this->mkdir('/');
78+
79+
// home storage is setup in the SetupManager
80+
if (!$this instanceof HomeObjectStoreStorage) {
81+
//initialize cache with root directory in cache
82+
if (!$this->is_dir('/')) {
83+
$this->mkdir('/');
84+
}
8185
}
8286

8387
$this->logger = \OC::$server->getLogger();

lib/private/Files/SetupManager.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ private function oneTimeUserSetup(IUser $user) {
254254
$this->mountManager->addMount($homeMount);
255255

256256
if ($homeMount->getStorageRootId() === -1) {
257-
$homeMount->getStorage()->mkdir('');
258-
$homeMount->getStorage()->getScanner()->scan('');
257+
$homeStorage = $homeMount->getStorage();
258+
$homeStorage->mkdir('');
259+
$homeStorage->mkdir('files');
260+
$homeStorage->getScanner()->scan('');
259261
}
260262

261263
$provider = $homeMount->getMountProvider();

0 commit comments

Comments
 (0)