]> source.dussan.org Git - nextcloud-server.git/commitdiff
ensure home storage is initialized on first setup
authorRobin Appelman <robin@icewind.nl>
Wed, 8 Jul 2020 11:58:27 +0000 (13:58 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 9 Jul 2020 09:14:45 +0000 (11:14 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Filesystem.php
lib/private/Files/Mount/LocalHomeMountProvider.php
lib/private/Files/Mount/MountPoint.php

index d3c4e1afc62a2fd3582214ed3fbc37b9792a36a7..9d534815cdc08f2b893f03aa5dc70fba7ab6cdfe 100644 (file)
@@ -437,6 +437,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);
 
index 744a57981e2f6ad4607524312143cae14f30cbb1..68c69cc8cdc2fdf91aa56862a782558371bb708d 100644 (file)
@@ -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];
index 2cb25f07044b599c90e459af2867c8da7268343a..f9cda6fbce8e1d1b8c22dd2fd3bec74b81f3374d 100644 (file)
@@ -268,7 +268,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;