Skip to content

fix(files_sharing): normalize share target on parent folder rename - #63956

Open
silverkszlo wants to merge 1 commit into
masterfrom
fix/trailing-slash-file-share
Open

fix(files_sharing): normalize share target on parent folder rename#63956
silverkszlo wants to merge 1 commit into
masterfrom
fix/trailing-slash-file-share

Conversation

@silverkszlo

Copy link
Copy Markdown

Summary

When a recipient moved an incoming share into one of their own folders and later renamed that folder, Updater::renameChildren passed the mount point to SharedMount::moveMount. Mount points always end in a slash, and stripUserFilesPath did not normalize its result, so the slash was stored in share.file_target. PROPFIND on such a share then returns 500.

Normalize the stripped path so no caller can write a trailing slash, and repair rows that are already affected.

To reproduce

  • As owner: create test.odt (or a folder) in Files and share it with recipient
  • As recipient: create your own folder at home root, e.g. box
  • As recipient: move the received test.odt into box
  • As recipient: rename box, e.g. "box_renamed"
  • Then check occ share:list --recipient=[recipient]
    → The name of the share has a trailing slash in target-path: /box_renamed/test.odt/

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

When a recipient moved an incoming share into one of their own folders
and later renamed that folder, Updater::renameChildren passed the mount
point to SharedMount::moveMount. Mount points always end in a slash, and
stripUserFilesPath did not normalize its result, so the slash was stored
in share.file_target. PROPFIND on such a share then returns 500.

Normalize the stripped path so no caller can write a trailing slash, and
repair rows that are already affected.

Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by: ClaudeCode:claude-opus-5
@silverkszlo silverkszlo added the bug label Sep 2, 2026
@silverkszlo
silverkszlo requested a review from a team as a code owner September 2, 2026 13:02
@silverkszlo silverkszlo added the 3. to review Waiting for reviews label Sep 2, 2026
@silverkszlo
silverkszlo requested review from Altahrim, icewind1991, leftybournes and sorbaugh and removed request for a team September 2, 2026 13:02
@silverkszlo
silverkszlo requested a review from blizzz September 2, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants