GaloisInc / macaw

Open source binary analysis tools.
BSD 3-Clause "New" or "Revised" License
208 stars 21 forks source link

Make `--save-smt`/`--save-macaw` options accept a directory to create files in #413

Open RyanGlScott opened 4 months ago

RyanGlScott commented 4 months ago

The test suites for the macaw-*-symbolic suite of packages define --save-smt/--save-macaw switches, which can be used to dump intermediate SMT queries and Macaw CFGs to text files under the /tmp directory for debugging purposes. In https://github.com/GaloisInc/macaw/pull/411#discussion_r1693249528, @kquick observed that this isn't quite ideal, since generating these files in a global location like /tmp can mix them in with other runs of the test suite, possibly leading to users looking at the wrong files.

Instead, it would be better if --save-smt/--save-macaw each took a directory as an argument, dumping their contents to files contained in that directory. That way, the user can generate the files to a known location (e.g., the current directory). This would also make it easier to generate these files during CI and possibly save them as artifacts.

sauclovian-g commented 3 months ago

Also, on a multiuser/server machine dropping stuff with predictable names in /tmp (without taking precautions) is a bad idea and can lead to security advisories.