Repository navigation
Webdav PUT small file lock must be shared during hooks - #16912
Merged
Merged
Conversation
Fixed code path for Webdav PUT of small files to use shared locks during hook execution, and exclusive during the file operation This makes it possible for versions to be copied by accessing the file in a post_write hook.
|
A new inspection was created. |
Contributor
There was a problem hiding this comment.
why is this here in testcase.php instead of your test file?
Contributor
Author
There was a problem hiding this comment.
because it could be useful in other places.
Insist and I'll move it away.
Contributor
There was a problem hiding this comment.
This should be a base class for unit tests, if you want to make a helper class do it in a new file ;)
Contributor
There was a problem hiding this comment.
Also missing typehint for the view
Contributor
Author
There was a problem hiding this comment.
Ok, I'll move it to the test class.
Contributor
|
👍 looks good |
Contributor
|
👍 |
DeepDiver1975
added a commit
that referenced
this pull request
Jun 15, 2015
Webdav PUT small file lock must be shared during hooks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Fixed code path for Webdav PUT of small files to use shared locks during
hook execution, and exclusive during the file operation
This makes it possible for versions to be copied by accessing the file
in a post_write hook.
Fixes #16900
Please review @icewind1991 @DeepDiver1975 @nickvergessen
Note that I had to change the hook type from exclusive back to shared to run the post hooks.
Locking during post hooks will also be done for other code paths here: #16829 (comment)
I added a unit test. Ideally I'd have wanted to also check the locks during the file operation, but that would require extraordinary gymnastics, so I left it for now. Still, the current test would fail without the fix applied.