Skip to content

Commit e5497c7

Browse files
committed
fix: protect against infinite loops in setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 467487e commit e5497c7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/private/Files/SetupManager.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ function ($mountPoint, IStorage $storage, IMountPoint $mount) use ($reSharingEna
231231
* Update the cached mounts for all non-authoritative mount providers for a user.
232232
*/
233233
private function updateNonAuthoritativeProviders(IUser $user): void {
234+
// prevent recursion loop from when getting mounts from providers ends up setting up the filesystem
235+
static $updatingProviders = false;
236+
if ($updatingProviders) {
237+
return;
238+
}
239+
$updatingProviders = true;
240+
234241
$providers = $this->mountProviderCollection->getProviders();
235242
$nonAuthoritativeProviders = array_filter(
236243
$providers,
@@ -243,6 +250,8 @@ private function updateNonAuthoritativeProviders(IUser $user): void {
243250
$providerNames = array_map(fn (IMountProvider $provider) => get_class($provider), $nonAuthoritativeProviders);
244251
$mount = $this->mountProviderCollection->getUserMountsForProviderClasses($user, $providerNames);
245252
$this->userMountCache->registerMounts($user, $mount, $providerNames);
253+
254+
$updatingProviders = false;
246255
}
247256

248257
/**

0 commit comments

Comments
 (0)