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(files): Check if target path is a descendant of the shared folder #47756

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

solracsf
Copy link
Member

@solracsf solracsf commented Sep 4, 2024

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

@solracsf solracsf 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 icewind1991, a team, skjnldsv, yemkareems, susnux, come-nc and provokateurin and removed request for a team September 4, 2024 20:44
@solracsf solracsf added the bug label Sep 4, 2024
susnux

This comment was marked as resolved.

provokateurin

This comment was marked as resolved.

@solracsf solracsf added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Sep 5, 2024
@solracsf solracsf force-pushed the fixingPathShareCheck branch from 3cd9e0f to 014c6e6 Compare September 5, 2024 07:10
@solracsf solracsf added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 5, 2024
@solracsf solracsf force-pushed the fixingPathShareCheck branch from 014c6e6 to f7a3fd6 Compare September 5, 2024 07:18
@solracsf
Copy link
Member Author

solracsf commented Sep 5, 2024

/backport to stable30

@solracsf
Copy link
Member Author

solracsf commented Sep 5, 2024

/backport to stable29

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

This comment was marked as outdated.

@solracsf solracsf force-pushed the fixingPathShareCheck branch from f7a3fd6 to 2cf3087 Compare September 5, 2024 09:17
@solracsf

This comment was marked as resolved.

@provokateurin

This comment was marked as resolved.

@solracsf
Copy link
Member Author

solracsf commented Sep 5, 2024

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
Member

Ok, sounds good then.

@susnux susnux 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
@susnux susnux force-pushed the fixingPathShareCheck branch from 2cf3087 to 0308001 Compare September 5, 2024 21:54
@susnux susnux merged commit 141fed8 into master Sep 6, 2024
174 checks passed
@susnux susnux deleted the fixingPathShareCheck branch September 6, 2024 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
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