diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 16:55:03 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 16:55:03 +0000 |
| commit | 098074193b7a3147f4ad0e0424618b52fe370026 (patch) | |
| tree | 44015e2cf890210f5352314d4840e2f85128176a /src/test_btfaddr.cpp | |
| parent | fcd0e6697038e5959df733e389124f6ccfa4a6d5 (diff) | |
build: quote the RandomX path so the guard cannot be stepped around
The marker guard added in fd627b1 used $(RANDOMX_DIR) unquoted, so an
operator-supplied value that expands to anything other than one word
walked straight past it. With a glob matching two directories,
`[ -d $(RANDOMX_DIR) ]` became a two-argument test, died with
"unexpected operator" rather than answering, and short-circuited the
&& before the marker was ever looked for -- leaving `rm -rf` to run
against every match. A value holding a space or a `&&` broke the outer
test the same way and reported "already built", and an apostrophe made
the recipe unparseable. So the commit's claim to refuse any directory
lacking the marker was falsifiable.
Quote every use, and reject up front the values that cannot name one
directory: empty and / now refuse deliberately rather than by way of
the one-argument `[ -d ]` quirk that happened to catch them, and
whitespace and glob characters are refused outright because
src/Makefile interpolates the same value into -I and -L unquoted,
where neither survives. A relative value is refused too: it named a
different directory here than in src/, and cd'ing into it made the
later mkdir -p resolve against the new cwd, so the build landed in
randomx-build/randomx-build/build and cmake found nothing.
Verified against the recipe text as make expands it, with rm replaced
by an echo, over empty, /, globs matching one and two directories,
spaces, tabs, relative paths, symlinks, apostrophes, semicolons,
backticks and newlines, under both dash and bash: every run either
refuses with a message or passes rm exactly one argument, identical to
the path the guard tested.
Diffstat (limited to 'src/test_btfaddr.cpp')
0 files changed, 0 insertions, 0 deletions