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(encryption): Fix mountpoint check to accept if several are found #47044

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Aug 5, 2024

Summary

There is no strong requirement to have only one mount for a given
storage id. Also the error in this case would be misleading.

Avoids errors "Could not find mount point, can't keep encryption keys" in situations where several mounts are found for the storage.

Checklist

There is no strong requirement to have only one mount for a given
 storage id. Also the error in this case would be misleading.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added this to the Nextcloud 30 milestone Aug 5, 2024
@come-nc come-nc self-assigned this Aug 5, 2024
@come-nc
Copy link
Contributor Author

come-nc commented Aug 5, 2024

/backport to stable29

@come-nc
Copy link
Contributor Author

come-nc commented Aug 5, 2024

/backport to stable28

@Altahrim Altahrim mentioned this pull request Aug 6, 2024
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish bug and removed 3. to review Waiting for reviews labels Aug 6, 2024
@Altahrim Altahrim mentioned this pull request Aug 7, 2024
@AndyScherzinger AndyScherzinger merged commit 609fa7d into master Aug 7, 2024
165 of 169 checks passed
@AndyScherzinger AndyScherzinger deleted the fix/accept-several-mounts-in-encryption branch August 7, 2024 18:58
@danxuliu
Copy link
Member

This introduced a regression when using groupfolders and encryption. Now it is no longer possible to move a file from a groupfolder to the home storage if the encryption module is enabled, even if neither the groupfolder nor the home storage are encrypted (this is unrelated to nextcloud/groupfolders#2942, which fixes moving files into an encrypted groupfolder).

This is reproducible in latest master and stable30, but also on stable29 and stable28 due to the backports; it is already present in Nextcloud 28.0.9rc1 and 29.0.5rc1.

How to reproduce

  • Enable the default encryption module (occ app:enable encryption)
  • Enable encryption (occ config:app:set --value=yes core encryption_enabled)
  • Optionally (it does not matter if encryption is enabled or not for the home storage, but maybe it can help debugging the issue), disable encryption in the home storage (occ config:app:set --value=0 encryption encryptHomeStorage)
  • Enable groupfolders (occ app:enable groupfolders)
  • Create a groupfolder (occ groupfolders:create test_group_folder)
  • Add group to groupfolder (occ groupfolders:group 1 admin read write share delete)
  • Upload file into the groupfolder (curl --user admin:admin --upload-file /PATH/TO/test.txt --header "OCS-APIRequest: true" http://127.0.0.1:8000/remote.php/dav/files/admin/test_group_folder/test.txt)
  • Try to move file from groupfolder to home (curl --user admin:admin --request MOVE --header "OCS-APIRequest: true" --header "Destination: http://127.0.0.1:8000/remote.php/dav/files/admin/test.txt" "http://127.0.0.1:8000/remote.php/dav/files/admin/test_group_folder/test.txt")

Expected result

The file is moved

Actual result

An internal error occurs:

  <s:exception>BadMethodCallException</s:exception>
  <s:message>path needs to be relative to the system wide data folder and point to a user specific file</s:message>

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 feature: encryption (server-side)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants