-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fixed moving of master key encrypted and versioned files between shared folders #16696
Conversation
This fixes the problem for master key encrypted files and improves the situation a bit for user key encrypted files. |
Copied over from #16419 as suggested by @kesselb: It seems that moving user key encrypted folders leads into some weird locking issues in the This is a write-down of what the general problem was:
The general logic can be found in lib/private/Files/Storage/Wrapper/Encryption.php: moveFromStorage() which first copies the file/folder with the help of lib/private/Files/Storage/Wrapper/Encryption.php:copyBetweenStorage() and then deletes the file/folder. One task that has to be done is to update the When
What we did for now to remedy this problem:
|
@yahesh Thanks for the PR. Ideally there would be one or more tests added to the codebase in order to avoid future regressions (and they also help to some extent in documenting the PR). |
@jknockaert As you may have read in the corresponding issue, this problem occurs some 32 levels down into the call stack. I really have no idea how to properly mock this misbehaviour so that the requested test isn't much more than a dummy placeholder. |
@yahesh Ja this is pretty low-level stuff. |
This looks like a lot of good work (diagnostic + solution) to solve a severe problem. It would be great to see some progress. I'm stuck with files that are most likely in a bad state because of this. |
@yahesh mind to have a look at the conflicting files? I don't know how soon one has time to review it but would be nice to have at least a recent ci run. |
It certainly is frustrating when good work is not put to use and is abandoned for some time. But the excellent diagnostic is still valid and will be a great help to get this fixed. I would not go as far as to say it was wasted 😄 |
@yahesh thanks a lot for updating the pull request ! |
@papimla exactly, now we only need to hope that the Nextclouders will take their precious time to check this PR. |
Thanks a lot @yahesh for looking into this and providing such a detailed issue description together with the fix. The changes make sense and the fix works like a charm. |
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.
Code looks good 👍
Rebased to trigger CI again. Then this can be merged. |
Unfortunately the tests fail :/ |
@@ -286,7 +286,7 @@ public function fopen($path, $mode) { | |||
} | |||
} | |||
$info = [ | |||
'target' => $this->getMountPoint() . $path, | |||
'target' => $this->getMountPoint() . '/' . $path, |
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.
Moved to #22902 as it is unrelated to this PR.
Signed-off-by: Kenny <k.niehage@syseleven.de>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
I extracted the unrelated stuff out in #22898, #22902 and #22903. After rebasing this PR and testing it again it doesn't solve the issue for me. But also on master there were already some fixes. @juliushaertl do you mind to check it out again as well? Maybe I have overseen something? |
@yahesh mind to do another rebase to have recent CI run? Heads up: Your branch was changed in the meantime. |
Let's close this one for now. If it still solves an issue we can reopen it. |
This fixes #16419 for master key encrypted files.