fix: Prefer mount owner over current user as owner of the storage#3538
Merged
juliusknorr merged 1 commit intomasterfrom Jan 16, 2025
Merged
fix: Prefer mount owner over current user as owner of the storage#3538juliusknorr merged 1 commit intomasterfrom
juliusknorr merged 1 commit intomasterfrom
Conversation
Signed-off-by: Julius Knorr <[email protected]>
8 tasks
provokateurin
approved these changes
Jan 16, 2025
Member
Author
|
/backport to stable30 |
Member
Author
|
/backport to stable29 |
elzody
approved these changes
Jan 16, 2025
|
The backport to # Switch to the target branch and update it
git checkout stable29
git pull origin stable29
# Create the new backport branch
git checkout -b backport/3538/stable29
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 3612926d
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/3538/stable29Error: No changes found in backport branch Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
|
The backport to # Switch to the target branch and update it
git checkout stable30
git pull origin stable30
# Create the new backport branch
git checkout -b backport/3538/stable30
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 3612926d
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/3538/stable30Error: No changes found in backport branch Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
This was referenced Jan 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes nextcloud/server#40090 (comment)
This pull request fixes an issue where the current user is wrongly assumed as the storage owner. This then may lead to the files_versions app not being able to store a version properly, ending up with a file that cannot be saved in a rather specific scenario:
Steps to reproduce:
I'm not sure if there is a case where this could also be triggered without collabora.
We set userB in richdocuments as the active user
https://github.com/nextcloud/richdocuments/blob/b4b76b4b326005eb469b13643bfe7e2d9fdcb580/lib/Controller/WopiController.php#L436
This then later on fails when files_versions tries to get path for the node:
https://github.com/nextcloud/server/blob/369274c9ee82eed6010a1a3b9cc5bac1a9926e2c/apps/files_versions/lib/Listener/FileEventsListener.php#L374-L383
For the mountpoint of a share we should still assume the mount owner as the storage owner instead of always taking the current user. Using the user from the session used to be the fallback for any storage that does have shared ownership, but we can be more specific here with the mount owner.