-
Notifications
You must be signed in to change notification settings - Fork 2.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
Slow transfer can bypass etag precondition check, no conflict file #16569
Comments
CC @cmonteroluque Setting to sev high for now. |
It also looks like no version is created for the "web" version of the file, so that edit is completely lost. The race condition is that both edits must happen at the same time after both did the precondition check. |
Currently the precondition check is done by Sabre before reaching our code. |
Note: some other conditions could happen at the time of the final rename:
|
I'll set this to 8.2 for now to keep it in mind. |
Fix is in #17811 |
Steps to reproduce
sleep(30)
here: https://github.com/owncloud/core/blob/master/lib/private/connector/sabre/file.php#L190 (before the final rename)Expected result
Conflict must occur.
Actual result
File edited from web UI was overwritten
This happens because the precondition check happens before the transfer is finished.
If chunk assembly or writing the part file takes longer (for example with ext storage), we're way past the precondition check and the write operation will simply overwrite what's there.
I didn't check what happens with the etag and other clients, it might also create a situation where one client believes it has the latest version even though the contents is different (to be confirmed).
I hope we can fix this somehow with high-level file locking #11804. We need to make sure the precondition check + final rename are atomic.
Versions
Observed on master (f70c309)
@dragotin @guruz FYI, maybe this was already known.
@DeepDiver1975 @karlitschek @icewind1991
The text was updated successfully, but these errors were encountered: