-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Always create user directory when transfering files to new users #37625
Merged
Conversation
This file contains 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
Signed-off-by: Julius Härtl <jus@bitgrid.net>
/backport to stable26 |
/backport to stable25 |
/backport to stable24 |
9 tasks
skjnldsv
approved these changes
Apr 6, 2023
szaimen
approved these changes
Apr 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but didnt test
Failure unrelated |
This was referenced Apr 11, 2023
artonge
added a commit
that referenced
this pull request
Feb 25, 2025
This PR currently implements solution n°1. ## Issue When using S3 as primary storage, transferring ownership with the `--move` option fail. The `--move` option moves the entire home folder from one account to another. ## Investigation 1. With S3 as primary storage, an entry in `oc_filecache` is created when calling `mkdir(...)`. This is because folders only exists in the cache when using S3 as primary. 2. Since #37625, we are calling `setupFS(..)` for the destination user, which calls `mkdir(...)`, which create the entry in `oc_filecache`. 3. With S3 as primary, `moveFromStorage(...)` will only move the teh cache entry as nothing needs to be moved on disk. This cache move does not delete potentially pre-existing destination folder. - `transfer(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/apps/files/lib/Service/OwnershipTransferService.php#L112 - `oneTimeUserSetup(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/SetupManager.php#L261-L262 - `mkdir(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L91-L135 - moveFromStorage(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L635-L636 ## Solutions 1. Do not create a cache entry during `mkdir(...)` 2. Delete pre-existing folder in `moveFromStorage(...)` 3. ? Signed-off-by: Louis Chemineau <louis@chmn.me>
2 tasks
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.
#30953 was originally there to fix this however with the partial file system setup in 24 we no longer setup the full file system when requesting the user root. This means that the call for getUserFolder does not create the folder but returns a LazyRootFolder instead. However since further handling of transfer ownership does not go through the Nodes API the actual RootFolder handling is never triggered. Explicitly calling for a full FS setup fixes this.
Steps to reproduce:
Fixes #35111