-
Notifications
You must be signed in to change notification settings - Fork 363
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
path normalization / absolutization is not allowed to use File::getCanonicalPath() #1575
Conversation
* simplify * add logs
* org.sonar.api.batch.fs.FileSystem::resolvePath() returns canonical form * rewrite it by means of Path::normalize() * review the sensor code, which performs normalization * minor changes
Path absolutization is never a good idea. Especially in the coverage sensor, which caches the file paths. See SonarOpenCommunity#1465
@jmecosta ok for me. Do you have any comments? Think you had some special cases in your CI? |
@guwirth i think we have integration tests for bullseye in place, it should be ok by me also. i will raise issue if something goes bad in our instances. i dont expect so |
Hi @guwirth and @ivangalkin . I've recently bumped in this issue in 1.1.0 and seems to be fixed by this PR. Any plans for releasing this? |
Hi @ericlemes, will be part of 1.2, see #1579. You are welcome to try it out and give feedback. |
Path normalization / absolutization is not allowed to use
File::getCanonicalPath()
. If performed on Linux (Unix), this method resolves the symbolic links. This fact might make the queries like "is this normalized path in SonarQube project" go wrong.Fixed #1574
Fixes #1465
CoberturaParser
usedCxxUtils::normalizePathFull()
Misc:
CxxUtils::normalizePathFull()
This change is