Closed moritzbuhl closed 5 years ago
Thanks for the explanation, I understand now better. This is indeed a bug and needs to be fixed. Thanks for the PR. I added an alternative implementation to the one in this PR in d75a2c09aa087e60bf020b011029a266f3c19b46, which should behave the same but be more clear. Could you please test this?
ant tests
now passes on OpenBSD. Thanks.
[junitreport] Transform time: 10135ms
[exec] 11952 / 21578 instructions covered
[exec] 55.3897% covered
[move] Moving 1 file to java-common-lib
tests:
BUILD SUCCESSFUL
Total time: 3 minutes 30 seconds
JAVA_IO_TMPDIR.value() is "/tmp/" in OpenBSD. Adding another '/' to the end would make the TEMP_DIR string in the FileTypeConverter class longer but the path object will optimize the path. Therefore "/tmp//.." is not "/tmp/.." (for a string comparison) and "/tmp/../file" became "./file" in the FileTypeConverterTest class after a call to CheckSafePath.