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

[stable28] Fix encryption wrapper not seen by groupfolder cache #3132

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Aug 22, 2024

Backport of #2942

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Jail wrappers reuse the cache of the wrapped storage even if another
storage is explicitly given. Due to that, when the cache is got from an
storage and that storage has a Jail all the wrappers above it are not
known to the cache, and only those wrapped by the Jail are taken into
account.

In general that works fine, as in most cases the cache does not need to
know the details of a storage. However, it needs to know if an
Encryption wrapper is present in the storage when moving files into it,
as the file cache explicitly clears the "encrypted" flag when moving a
file from an encrypted storage to a non encrypted storage.

As the Encryption wrapper of groupfolders was not known to the cache all
files moved from an encrypted storage to an encrypted groupfolder ended
wrongly marked as not encrypted.

To solve that now the Jail used by groupfolders does not reuse the inner
cache when encryption is enabled, and instead passes the given storage.
This is applied only when encryption is enabled, as reusing the inner
cache was done as a performance optimization.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@backportbot backportbot bot added bug 3. to review Items that need to be reviewed labels Aug 22, 2024
@backportbot backportbot bot added this to the Nextcloud 28.0.1 milestone Aug 22, 2024
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E2E tests were dropped, as there are no other E2E tests in stable28. Nevertheless, I manually tested all the scenarios from encryption.cy.ts and works 👍

Independently of that I amended the PHP stubs with an extra field that was not included in them (although it was already included in the stubs of stable30) and removed the [skip-ci] line.

@danxuliu danxuliu marked this pull request as ready for review August 23, 2024 13:03
@skjnldsv skjnldsv merged commit 9e31b1d into stable28 Aug 28, 2024
26 checks passed
@skjnldsv skjnldsv deleted the backport/2942/stable28 branch August 28, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Items that need to be reviewed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants