Skip to content
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

fix symlink issue in path resolution #112

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

willarmiros
Copy link
Member

When passing a path that includes a symlink to scan, it messes up the path resolution logic because we are calling resolve (which removes symlinks) on the absolute path, but not on the individual file paths. So when we try to do relative_to, the absolute path is NOT using symlinks, and the file_path IS using symlinks, which causes a path mismatch.
This change should fix this.

@willarmiros willarmiros requested a review from mehrinkiani March 4, 2024 23:24
Copy link
Member

@mehrinkiani mehrinkiani left a comment

Choose a reason for hiding this comment

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

LGTM!

@willarmiros
Copy link
Member Author

I don't think I have merge abilities, feel free to merge whenever @mehrinkiani !

@mehrinkiani mehrinkiani merged commit c17858b into protectai:main Mar 5, 2024
8 checks passed
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.

2 participants