summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-18 09:21:32 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-02-18 13:55:54 +0100
commit7abb8693a16f96c3bcb252afce39fbd29ec0ed57 (patch)
tree14122775165da80c0ed21634dde6e4511ddd3736 /lib
parent73d46afc3c5ef237cc8a5431aa1bef4686a7521b (diff)
downloadnextcloud-server-7abb8693a16f96c3bcb252afce39fbd29ec0ed57.tar.gz
nextcloud-server-7abb8693a16f96c3bcb252afce39fbd29ec0ed57.zip
getRootFolder should not setup the FS for any user
Fixes #22467 This can go wrong when an app (take the ldap app) DIs something that needs the rootFolder. This break if we use cookie auth since then we know the user at that point and thus try to setup the fs for that user. However if there are then incomming shares from an ldap user they will fails since the user manager can't find them yet. Now getRootFolder does not setup the fs for any user.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/filesystem.php4
-rw-r--r--lib/private/server.php9
-rw-r--r--lib/private/util.php4
3 files changed, 7 insertions, 10 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index 9d4a2c0aa05..d6fc9648c1e 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -237,9 +237,9 @@ class Filesystem {
*
* @return \OC\Files\Mount\Manager
*/
- public static function getMountManager() {
+ public static function getMountManager($user = '') {
if (!self::$mounts) {
- \OC_Util::setupFS();
+ \OC_Util::setupFS($user);
}
return self::$mounts;
}
diff --git a/lib/private/server.php b/lib/private/server.php
index ef4764d07cf..96eb5386ad6 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -165,14 +165,9 @@ class Server extends ServerContainer implements IServerContainer {
return $c->query('SystemTagManagerFactory')->getObjectMapper();
});
$this->registerService('RootFolder', function (Server $c) {
- // TODO: get user and user manager from container as well
- $user = \OC_User::getUser();
- /** @var $c SimpleContainer */
- $userManager = $c->query('UserManager');
- $user = $userManager->get($user);
- $manager = \OC\Files\Filesystem::getMountManager();
+ $manager = \OC\Files\Filesystem::getMountManager(null);
$view = new View();
- $root = new Root($manager, $view, $user);
+ $root = new Root($manager, $view, null);
$connector = new HookConnector($root, $view);
$connector->viewToNode();
return $root;
diff --git a/lib/private/util.php b/lib/private/util.php
index 6ad668dedaa..35ae3e3090b 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -128,7 +128,9 @@ class OC_Util {
\OC::$server->getEventLogger()->start('setup_fs', 'Setup filesystem');
// If we are not forced to load a specific user we load the one that is logged in
- if ($user == "" && OC_User::isLoggedIn()) {
+ if ($user === null) {
+ $user = '';
+ } else if ($user == "" && OC_User::isLoggedIn()) {
$user = OC_User::getUser();
}