Skip to content

fix: std::filesystem::equivalent does not work for non-exist path #2182

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

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

vansangpfiev
Copy link
Contributor

Describe Your Changes

This pull request includes an important change to the SanitizePath function in engine/repositories/file_fs_repository.cc. The change simplifies the logic for verifying that a resolved path is within the specified base directory.

Path sanitization improvement:

  • engine/repositories/file_fs_repository.cc: Simplified the loop that checks if the resolved path is within the base directory by replacing it with a string search. This change ensures the resolved path contains the base directory path substring.

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@vansangpfiev vansangpfiev merged commit 082601b into dev Mar 27, 2025
7 of 8 checks passed
@vansangpfiev vansangpfiev deleted the s/fix/fs-equivalent branch March 27, 2025 07:45
vansangpfiev added a commit that referenced this pull request Mar 27, 2025
)

* fix: std::filesystem::equivalent does not work for non-exist path

* chore: enable create file test for all platforms (#2183)

---------

Co-authored-by: sangjanai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants