From 517277b4308ff41909bef8c0f7ae0b7970f8291f Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 18 Oct 2016 11:35:54 +0200 Subject: [PATCH] Fix initMountPoints to set usersSetup earlier This is needed because in some cases like LDAP, the user manager itself might trigger avatar updates which would internally also call initMountPoints with the same user. This could cause the same user to be setup twice, and in some sharing situations could cause recursive deduplication of shares by adding "(2)" every time. --- lib/private/Files/Filesystem.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index 3d3345a5c80f..1c9f9d600546 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -397,16 +397,18 @@ public static function initMountPoints($user = '') { return; } + self::$usersSetup[$user] = true; + $userManager = \OC::$server->getUserManager(); $userObject = $userManager->get($user); if (is_null($userObject)) { \OCP\Util::writeLog('files', ' Backends provided no user object for ' . $user, \OCP\Util::ERROR); + // reset flag, this will make it possible to rethrow the exception if called again + self::$usersSetup[$user] = false; throw new \OC\User\NoUserException('Backends provided no user object for ' . $user); } - self::$usersSetup[$user] = true; - /** @var \OC\Files\Config\MountProviderCollection $mountConfigManager */ $mountConfigManager = \OC::$server->getMountProviderCollection();