Skip to content

fix(files): Check if target path is a descendant of the shared folder - #47756

Merged
susnux merged 1 commit into
masterfrom
fixingPathShareCheck
Sep 6, 2024
Merged

fix(files): Check if target path is a descendant of the shared folder#47756
susnux merged 1 commit into
masterfrom
fixingPathShareCheck

Conversation

@solracsf

@solracsfsolracsf commented Sep 4, 2024

Copy link
Copy Markdown
Member

Fix#47713 (tested)

Summary

Check is overly broad because it triggers if the target path starts with the shared folder's path, even if the target path is a sibling or a nested folder that is not actually within the shared folder.

The function should check if the target path is a direct descendant of the shared folder path rather than just starting with it. This can be done by ensuring that the target path either matches the shared path exactly or has a / immediately following the shared folder path.

Checklist

@solracsfsolracsf added 2. developing Work in progress 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 4, 2024
@solracsf
solracsf requested review from a team, come-nc, icewind1991, provokateurin, skjnldsv, susnux and yemkareems and removed request for a teamSeptember 4, 2024 20:44
@solracsfsolracsf added the bug label Sep 4, 2024
susnux

This comment was marked as resolved.

provokateurin

This comment was marked as resolved.

@solracsfsolracsf added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Sep 5, 2024
@solracsfsolracsf added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 5, 2024
@solracsf

Copy link
Copy Markdown
MemberAuthor

/backport to stable30

@solracsf

Copy link
Copy Markdown
MemberAuthor

/backport to stable29

@solracsfsolracsf added this to the Nextcloud 31 milestone Sep 5, 2024
@provokateurin

This comment was marked as outdated.

@solracsf

This comment was marked as resolved.

@provokateurin

This comment was marked as resolved.

@solracsf

solracsf commented Sep 5, 2024

Copy link
Copy Markdown
MemberAuthor

Well, the report is about 29 only, and that function was reworked on 29 only at that time (no backport to 28).
#43791

So, I believe 28 is not affected.

@provokateurin

Copy link
Copy Markdown
Member

Ok, sounds good then.

@susnuxsusnux added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Sep 5, 2024
…lder path
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: tests
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: fix tests
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: add tests
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: tests
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Move or copy operation failed on Nextcloud server 29.0.6

3 participants

@solracsf@provokateurin@susnux