semgrep / testo

Test framework for OCaml
ISC License
16 stars 1 forks source link

Fix mask_temp_paths to handle symlinks #54

Closed IagoAbal closed 5 months ago

IagoAbal commented 5 months ago

If tmpdir is not a realpath, i.e. contains symlinks, 'mask_temp_paths' will not work as expected.

test plan: See semgrep/semgrep#10077

PR checklist:

Check out CONTRIBUTING.md for more details.

mjambon commented 5 months ago

Unfortunately, Unix.realpath is not available in OCaml 4.08. This is why masking this variant of the temp dir path is left to the user. In semgrep, use Testutil.mask_temp_paths () which will replace both the literal temp dir path and the physical path obtained with Unix.realpath.