Skip to content

Conversation

@PVince81
Copy link
Contributor

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 reached Node: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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Verify target path earlier to make sure 403 is returned in case of wrong
target (ex: ".htaccess") instead of 404.
@PVince81
Copy link
Contributor Author

@individual-it I can't find them

Copy link
Member

@individual-it individual-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 fixes the issue

@individual-it
Copy link
Member

sorry did overlooked one file in your commit

@PVince81
Copy link
Contributor Author

stable10: #28737

@DeepDiver1975 DeepDiver1975 merged commit 3f6b2a4 into master Aug 18, 2017
@DeepDiver1975 DeepDiver1975 deleted the newdav-rename-forbiddentarget branch August 18, 2017 18:58
@lock
Copy link

lock bot commented Aug 2, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Renaming to .htaccess problems in UI

6 participants