Browse Source
ensure home storage is initialized on first setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/21489/head
Robin Appelman
5 years ago
committed by
Roeland Jago Douma
No known key found for this signature in database
GPG Key ID: F941078878347C0C
3 changed files with
6 additions and
2 deletions
-
lib/private/Files/Filesystem.php
-
lib/private/Files/Mount/LocalHomeMountProvider.php
-
lib/private/Files/Mount/MountPoint.php
|
|
|
@ -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); |
|
|
|
|
|
|
|
|
|
|
|
@ -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]; |
|
|
|
|
|
|
|
@ -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; |
|
|
|
|