Skip to content

Commit

Permalink
Fix checking for locks in root folder
Browse files Browse the repository at this point in the history
Only check up to the root of the user folder instead of the global root

Technically we should maybe even abort earlier when we found a non
encrypted folder.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan committed Dec 14, 2022
1 parent 5fe86dc commit 1d969af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/LockManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function isLocked(int $id, string $token): bool {
$userRoot = $this->rootFolder->getUserFolder($user->getUID());
$nodes = $userRoot->getById($id);
foreach ($nodes as $node) {
while ($node->getPath() !== '/') {
while ($node->getPath() !== $userRoot->getPath()) {
try {
$lock = $this->lockMapper->getByFileId($node->getId());
} catch (DoesNotExistException $ex) {
Expand Down

0 comments on commit 1d969af

Please sign in to comment.