LauncherV3 icon indicating copy to clipboard operation
LauncherV3 copied to clipboard

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

Open Brycey92 opened this issue 3 years ago • 3 comments

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

Brycey92 avatar Aug 13 '21 22:08 Brycey92

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[bot] avatar Nov 12 '21 01:11 stale[bot]

Unstale, please!

Brycey92 avatar Nov 19 '21 16:11 Brycey92

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

github-actions[bot] avatar Aug 26 '23 01:08 github-actions[bot]