Skip to content

Commit 9d9973c

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

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
@@ -102,7 +102,7 @@ public function registerMounts(IUser $user, array $mounts, array $mountProviderC
102102
if (is_array($mountProviderClasses)) {
103103
$cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use (
104104
$mountProviderClasses
105-
) {
105+
): bool {
106106
return in_array($mountInfo->getMountProvider(), $mountProviderClasses);
107107
});
108108
}
@@ -139,7 +139,7 @@ public function registerMounts(IUser $user, array $mounts, array $mountProviderC
139139
$this->removeFromCache($mount);
140140
foreach ($mountsForUsers as $index => $mountForUser) {
141141
/** @var ICachedMountInfo $mountForUser */
142-
if ($mount->getRootId() == $mountForUser->getRootId() && $mount->getMountPoint() == $mountForUser->getMountPoint()) {
142+
if ($mount->getRootId() === $mountForUser->getRootId() && $mount->getMountPoint() === $mountForUser->getMountPoint()) {
143143
unset($mountsForUsers[$index]);
144144
break;
145145
}

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
@@ -239,8 +239,10 @@ private function oneTimeUserSetup(IUser $user) {
239239
$this->mountManager->addMount($homeMount);
240240

241241
if ($homeMount->getStorageRootId() === -1) {
242-
$homeMount->getStorage()->mkdir('');
243-
$homeMount->getStorage()->getScanner()->scan('');
242+
$homeStorage = $homeMount->getStorage();
243+
$homeStorage->mkdir('');
244+
$homeStorage->mkdir('files');
245+
$homeStorage->getScanner()->scan('');
244246
}
245247

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

0 commit comments

Comments
 (0)