summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-07-08 13:58:27 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-07-09 12:33:29 +0000
commitcc35da4d28ed4da9ad7b11a3a907cc99c535b10a (patch)
tree9520b37639488e081c011a9c4972680ee2262a29 /lib/private/Files
parent2eb61b4111d4269239c68c4d057192c7bb857a56 (diff)
downloadnextcloud-server-cc35da4d28ed4da9ad7b11a3a907cc99c535b10a.tar.gz
nextcloud-server-cc35da4d28ed4da9ad7b11a3a907cc99c535b10a.zip
ensure home storage is initialized on first setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Filesystem.php4
-rw-r--r--lib/private/Files/Mount/LocalHomeMountProvider.php2
-rw-r--r--lib/private/Files/Mount/MountPoint.php2
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php
index 358c707f186..4b04656f49b 100644
--- a/lib/private/Files/Filesystem.php
+++ b/lib/private/Files/Filesystem.php
@@ -438,6 +438,10 @@ class Filesystem {
// home mounts are handled seperate since we need to ensure this is mounted before we call the other mount providers
$homeMount = $mountConfigManager->getHomeMountForUser($userObject);
+ if ($homeMount->getStorageRootId() === -1) {
+ $homeMount->getStorage()->mkdir('');
+ $homeMount->getStorage()->getScanner()->scan('');
+ }
self::getMountManager()->addMount($homeMount);
diff --git a/lib/private/Files/Mount/LocalHomeMountProvider.php b/lib/private/Files/Mount/LocalHomeMountProvider.php
index 744a57981e2..68c69cc8cdc 100644
--- a/lib/private/Files/Mount/LocalHomeMountProvider.php
+++ b/lib/private/Files/Mount/LocalHomeMountProvider.php
@@ -35,7 +35,7 @@ class LocalHomeMountProvider implements IHomeMountProvider {
*
* @param IUser $user
* @param IStorageFactory $loader
- * @return \OCP\Files\Mount\IMountPoint[]
+ * @return \OCP\Files\Mount\IMountPoint|null
*/
public function getHomeMountForUser(IUser $user, IStorageFactory $loader) {
$arguments = ['user' => $user];
diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php
index 2b5fa3f7199..d9d5117cd3f 100644
--- a/lib/private/Files/Mount/MountPoint.php
+++ b/lib/private/Files/Mount/MountPoint.php
@@ -267,7 +267,7 @@ class MountPoint implements IMountPoint {
* @return int
*/
public function getStorageRootId() {
- if (is_null($this->rootId)) {
+ if (is_null($this->rootId) || $this->rootId === -1) {
$this->rootId = (int)$this->getStorage()->getCache()->getId('');
}
return $this->rootId;