Allow symlinked folder within root directory #4863
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.
Checklist:
This change removes resolving folder paths such that symlinked folders will now function, while still maintaining the original checks to make sure that changes aren't being made outside the root folder.
So any folders that have a relative path containing ../ (such as ~/home/presets, ../presets, /presets) will fail, but if you create a folder within your root folder of the project and symlink it outside, that will be fine
Tested adding a file and deleting a file which still work properly, tested trying to save outside the root folder which still fails properly
Ideally I will also look at having it fail more gracefully, since in its current state it just causes an error output in CLI and breaks the UI until you reload if you pass in an invalid path (which is the current behaviour in master, not caused by my changes)