Skip to content

fix(encryption): use the closest cached parent for the access list - #64289

Open
susnux wants to merge 1 commit into
masterfrom
fix/encryption-user-keys
Open

fix(encryption): use the closest cached parent for the access list#64289
susnux wants to merge 1 commit into
masterfrom
fix/encryption-user-keys

Conversation

@susnux

@susnux susnux commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Copying a folder creates the target directories on the storage before their cache entries exist, so while the files inside are written the parent of the target path can not be resolved yet. With per-user keys the encryption stream needs the access list on every write, so the unguarded $userFolder->get($parent) made every folder copy fail with a NotFoundException.

Walk up to the closest ancestor that is known to the cache instead. Shares only exist on cached nodes, so its access list is the one that applies and the share keys of the recipients are still created when copying into a shared folder.

Checklist

AI (if applicable)

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

Copying a folder creates the target directories on the storage before
their cache entries exist, so while the files inside are written the
parent of the target path can not be resolved yet. With per-user keys
the encryption stream needs the access list on every write, so the
unguarded $userFolder->get($parent) made every folder copy fail with a
NotFoundException.

Walk up to the closest ancestor that is known to the cache instead.
Shares only exist on cached nodes, so its access list is the one that
applies and the share keys of the recipients are still created when
copying into a shared folder.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux requested a review from a team as a code owner September 13, 2026 16:17
@susnux
susnux requested review from Altahrim, icewind1991, leftybournes and provokateurin and removed request for a team September 13, 2026 16:17
@susnux susnux added this to the Nextcloud 36 milestone Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants