mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 02:34:12 -04:00
Merge pull request #54205 from nextcloud/backport/54182/stable30
[stable30] fix: don't update cached mountpoints if the request doesn't have filesystem access
This commit is contained in:
commit
94a5e1440e
1 changed files with 9 additions and 3 deletions
|
|
@ -287,7 +287,7 @@ class SetupManager {
|
|||
$mounts = array_filter($mounts, function (IMountPoint $mount) use ($previouslySetupProviders) {
|
||||
return !in_array($mount->getMountProvider(), $previouslySetupProviders);
|
||||
});
|
||||
$this->userMountCache->registerMounts($user, $mounts, $newProviders);
|
||||
$this->registerMounts($user, $mounts, $newProviders);
|
||||
|
||||
$cacheDuration = $this->config->getSystemValueInt('fs_mount_cache_duration', 5 * 60);
|
||||
if ($cacheDuration > 0) {
|
||||
|
|
@ -452,7 +452,7 @@ class SetupManager {
|
|||
}
|
||||
|
||||
if (count($mounts)) {
|
||||
$this->userMountCache->registerMounts($user, $mounts, $currentProviders);
|
||||
$this->registerMounts($user, $mounts, $currentProviders);
|
||||
$this->setupForUserWith($user, function () use ($mounts) {
|
||||
array_walk($mounts, [$this->mountManager, 'addMount']);
|
||||
});
|
||||
|
|
@ -523,7 +523,7 @@ class SetupManager {
|
|||
$mounts = $this->mountProviderCollection->getUserMountsForProviderClasses($user, $providers);
|
||||
}
|
||||
|
||||
$this->userMountCache->registerMounts($user, $mounts, $providers);
|
||||
$this->registerMounts($user, $mounts, $providers);
|
||||
$this->setupForUserWith($user, function () use ($mounts) {
|
||||
array_walk($mounts, [$this->mountManager, 'addMount']);
|
||||
});
|
||||
|
|
@ -595,4 +595,10 @@ class SetupManager {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function registerMounts(IUser $user, array $mounts, ?array $mountProviderClasses = null): void {
|
||||
if ($this->lockdownManager->canAccessFilesystem()) {
|
||||
$this->userMountCache->registerMounts($user, $mounts, $mountProviderClasses);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue