aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2025-01-27 10:37:15 +0100
committerMaksim Sukharev <antreesy.web@gmail.com>2025-01-27 10:37:15 +0100
commitbbfc2dcc2e081229bd92cfe1e3e94885bb61fb9e (patch)
tree0d69cec986fd59b433eebd95b08b2a57e1b6f5a1
parent4061f240222e4da06eef4944a073fa85b4b1e6be (diff)
downloadnextcloud-server-backport/49887/stable29.tar.gz
nextcloud-server-backport/49887/stable29.zip
fix: perform check for overwritten storage before cache checkbackport/49887/stable29
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r--lib/private/Files/Utils/Scanner.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index 1536878ad7f..8f8d918997f 100644
--- a/lib/private/Files/Utils/Scanner.php
+++ b/lib/private/Files/Utils/Scanner.php
@@ -226,7 +226,10 @@ class Scanner extends PublicEmitter {
foreach (['', 'files'] as $path) {
if (!$storage->isCreatable($path)) {
$fullPath = $storage->getSourcePath($path);
- if (!$storage->is_dir($path) && $storage->getCache()->inCache($path)) {
+ if (isset($mounts[$mount->getMountPoint() . $path . '/'])) {
+ // /<user>/files is overwritten by a mountpoint, so this check is irrelevant
+ break;
+ } elseif (!$storage->is_dir($path) && $storage->getCache()->inCache($path)) {
throw new NotFoundException("User folder $fullPath exists in cache but not on disk");
} elseif ($storage->is_dir($path)) {
$ownerUid = fileowner($fullPath);
@@ -234,9 +237,6 @@ class Scanner extends PublicEmitter {
$owner = $owner['name'] ?? $ownerUid;
$permissions = decoct(fileperms($fullPath));
throw new ForbiddenException("User folder $fullPath is not writable, folders is owned by $owner and has mode $permissions");
- } elseif (isset($mounts[$mount->getMountPoint() . $path . '/'])) {
- // /<user>/files is overwritten by a mountpoint, so this check is irrelevant
- break;
} else {
// if the root exists in neither the cache nor the storage the user isn't setup yet
break 2;