aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-07-31 18:28:26 +0200
committerRobin Appelman <robin@icewind.nl>2025-07-31 18:28:26 +0200
commit73d041842560eea1803d5d223182f450c34e2e0a (patch)
treebd86088352bc55329007d5622092d07081765599
parent6033c2563066d72b46b8b9cbad30b52c97eb6922 (diff)
downloadnextcloud-server-mount-cache-without-fs-access.tar.gz
nextcloud-server-mount-cache-without-fs-access.zip
fix: don't update cached mountpoints if the request doesn't have filesystem accessmount-cache-without-fs-access
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Files/SetupManager.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index 37ecd5779e6..b92c608a81d 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -292,7 +292,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) {
@@ -457,7 +457,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']);
});
@@ -528,7 +528,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']);
});
@@ -600,4 +600,10 @@ class SetupManager {
});
}
}
+
+ private function registerMounts(IUser $user, array $mounts, ?array $mountProviderClasses = null): void {
+ if ($this->lockdownManager->canAccessFilesystem()) {
+ $this->userMountCache->registerMounts($user, $mounts, $mountProviderClasses);
+ }
+ }
}