-
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
When calling file_put_contents clear the checksum #24098
Conversation
@@ -126,6 +126,9 @@ public function update($path, $time = null) { | |||
$this->cache->correctFolderSize($path, $data); | |||
} | |||
$this->correctParentStorageMtime($path); | |||
if ($data['mimetype'] !== 'httpd/unix-directory') { | |||
$this->clearChecksum($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.
okay, I guess there is no easy way to integrate this change in one of the existing database calls.
@icewind1991 or is there a better moment ?
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.
Well it gets kind of messy trying to cram this into the scan call I think
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.
I think it would make sense in general to clear the checksum in the scanner if it detects a change
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.
@icewind1991 This will likely be needed too for the other issue #23783 but would it also cover the text editor / file_put_contents issue too ?
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.
scanFile indeed might be a good place...
Moved the check to the scanFile. Patch is simpler and cleaner. @PVince81 @icewind1991 please have another look. |
Code looks good 👍 |
@karlitschek we should backport this to 9.0.2 |
great. fix makes sense. please backport to stable9 |
|
Looks good 👍 |
@rullzer can you prepare the backport PR ? |
Backport in #24129 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #23782 and #23783
If a file is changed we should reset the checksum.
To test:
curl -u admin:admin http://localhost/master/remote.php/webdav/foo.txt -X PUT -T foo.txt -H "OC-Checksum: foobar"
Test 2:
curl -u admin:admin http://localhost/master/remote.php/webdav/foo.txt -X PUT -T foo.txt -H "OC-Checksum: foobar"
./occ files:scan admin
CC: @PVince81 @nickvergessen @MorrisJobke @dragotin