Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/private/Files/Utils/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,17 @@ public function scan($dir = '', $recursive = \OC\Files\Cache\Scanner::SCAN_RECUR
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);
$owner = posix_getpwuid($ownerUid);
$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;
Expand Down
Loading