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

Canonical paths should be used when checking if two Paths or Files point to the same place #199

Open
Brycey92 opened this issue Aug 13, 2021 · 3 comments
Labels

Comments

@Brycey92
Copy link

Brycey92 commented Aug 13, 2021

I was looking through the source for the launcher and found that when File::equals(File) is called, it just does a comparison on the Paths from the Files which is implemented as file1.getPath().compareToIgnoreCase(file2.getPath()). Anywhere else in the launcher code that compares Paths without first converting to canonical is subject to the issue as well.

For example, comparing /foo/bar/ and /foo/../foo/bar/ would currently give a false-negative when checked for equality in the above two styles, potentially resulting in data loss such as here:
https://github.com/TechnicPack/LauncherV3/blob/master/src/main/java/net/technicpack/autoupdate/tasks/MoveLauncherPackage.java#L63

@stale
Copy link

stale bot commented Nov 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Inactive issue label Nov 12, 2021
@Brycey92
Copy link
Author

Unstale, please!

@stale stale bot removed the stale Inactive issue label Nov 19, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale Inactive issue label Aug 26, 2023
@Pyker Pyker removed the stale Inactive issue label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants