Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check rootfolder for lock #370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Fix checking for locks in root folder
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
commit 1d969af9533edebb9d5b00f1057998de03ac1a4e
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()) {
CarlSchwan marked this conversation as resolved.
Show resolved Hide resolved
try {
$lock = $this->lockMapper->getByFileId($node->getId());
} catch (DoesNotExistException $ex) {
Expand Down