Skip to content

fix(files): do not let a failing move hook break the move or hide files - #61937

Merged
AndyScherzinger merged 1 commit into
masterfrom
fix/filesystem-move-hardening
Aug 7, 2026
Merged

fix(files): do not let a failing move hook break the move or hide files#61937
AndyScherzinger merged 1 commit into
masterfrom
fix/filesystem-move-hardening

Conversation

@solracsf

@solracsf solracsf commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

When renameFromStorage() moves a cache entry below a parent that is not in the cache, Cache::moveFromCache() attaches it to parent -1. The entry then no longer shows up in any folder listing until the next scan.

Additionally, OC_Hook::emit() actually catches Exceptions thrown by hook handlers so that a failing handler cannot break the operation that emitted the signal, but PHP Errors (TypeError etc.) escaped. A post hook handler failing with an Error therefore failed the whole request after the operation had already been performed. Catch Throwable instead.

Checklist

AI (if applicable)

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

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf added this to the Nextcloud 35 milestone Jul 9, 2026
@solracsf solracsf self-assigned this Jul 9, 2026
@solracsf solracsf added the community pull requests from community label Jul 9, 2026
@solracsf
solracsf marked this pull request as ready for review July 9, 2026 14:35
@solracsf
solracsf requested a review from a team as a code owner July 9, 2026 14:35
@solracsf
solracsf requested review from Altahrim, icewind1991, leftybournes, provokateurin and salmart-dev and removed request for a team July 9, 2026 14:35
@solracsf

Copy link
Copy Markdown
Member Author

/backport to stable34

@solracsf

Copy link
Copy Markdown
Member Author

/backport to stable33

@AndyScherzinger
AndyScherzinger merged commit 4eadcf2 into master Aug 7, 2026
289 of 309 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/filesystem-move-hardening branch August 7, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug community pull requests from community feature: filesystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

files disappear after movement

4 participants