Fix check new dav rename target path name #28735
Merged
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.
Description
Verify target path earlier to make sure 403 is returned in case of wrong
target (ex: ".htaccess") instead of 404.
The reason this happens is because the rename code path between old and new DAV endpoints are different. Old DAV fails earlier when Sabre's CorePlugin does a
getNodeForPath()on the target even for a local rename. New DAV doesn't go through this code path and reachedNode:setName()more directly, possibly due to the necessary changes that were done lately regarding moves.Related Issue
Fixes #28441.
Should also fix the renameFile/renameFolder failures on master.
Motivation and Context
How Has This Been Tested?
Manual testing with cadaver on new dav endpoint: rename "welcome.txt" to ".htaccess".
Before the fix: 404
After the fix: 403
Automated tests have been reenabled.
Screenshots (if appropriate):
Types of changes
Checklist: