Stop probing "link" as if it were the MSVC linker

The tool table probed the bare name, and coreutils' hard-link utility owns that name on
every host that has it -- including the Git Bash and MSYS installs on Windows, where the
row would be trusted most. The probe therefore reported the MSVC header toolchain present
on a host with no MSVC at all, and the present-tool count was one too high.

The row now probes editbin, whose name has no Unix collision, and its note says that
link.exe is not probed by name. strings stays in the table: binutils strings reads PE
images, so that row is true on a Unix host, and the test carries the reason the
distinction is per-name rather than per-existence.

tests/unit/test_hwprobe_tool_table.py pins three things: no row probes a name from the
ambiguity list; editbin is the row that carries header edits; and, as the general form,
every probed tool that resolves on this host is run with --version and must not identify
as GNU coreutils. FINDINGS F17 records the defect and how it surfaced -- by reading the
probe's own output while collecting host facts for a protected-sample run, where a row
claiming the MSVC linker sat beside gdb, a MinGW gcc and no cl.
This commit is contained in:
root committed 2026-10-27 16:50:07 +08:00
1 parent 5d7c41bdd5
commit 69a89abf0c
4 files changed
+86 -1

No files matched your search

+4 -1
View File
@@ -372,7 +372,10 @@ TOOL_NAMES = [
('cdb', 'command-line WinDbg engine'),
('gdb', 'MinGW debugging'),
('dumpbin', 'PE headers and imports (MSVC toolchain)'),
('link', 'editbin/link for header edits (MSVC toolchain)'),
# `link` is deliberately absent: the name is GNU coreutils' hard-link utility on every Linux
# host and on Git Bash/MSYS, and a probe that reports it as present claims the MSVC toolchain on
# a machine that has none. `editbin` carries the same capability and no collision.
('editbin', 'header edits (MSVC toolchain; link.exe is not probed by name)'),
('signtool', 'signature inspection and re-signing'),
('frida', 'runtime instrumentation'),
('frida-ps', 'process listing for frida'),