[LTP] binfmt_misc02.sh: Fix interpreter with uutils/coreutils
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Thu Oct 22 15:35:19 CEST 2026
Hi Kuan-Ying,
On Wed, 21 Oct 2026, Kuan-Ying Lee wrote:
> binfmt_misc02.sh: Fix interpreter with uutils/coreutils
> + interp_dir=$(mktemp -d "$TMPDIR/ltp_binfmt_miscXXXXXX")
> + [ -d "$interp_dir" ] || tst_brk TBROK "Failed to create interpreter dir"
With TMPDIR on a noexec filesystem and the datafiles on an executable
filesystem, open_exec() rejects this new interpreter with EACCES, causing
subtests 1-4 to report TFAIL despite working binfmt_misc support. The
previous system-cat interpreter did not depend on TMPDIR being executable.
Detect a noexec TMPDIR during setup and report TCONF, or place the wrapper
on an executable filesystem.
> + printf '#!/bin/sh\nexec %s "$1"\n' "$(command -v cat)" > "$interp" ||
The resolved cat pathname is inserted unquoted into shell source: with
cat in a PATH directory containing spaces, the generated exec command
splits the pathname and exits 127 instead of running cat. Generate a
literal exec cat "$1" command instead, letting the shell perform PATH
lookup without reparsing the resolved pathname.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list