Bruno Haible <[email protected]> writes:

> + /home/runner/work/ci-check/ci-check/coreutils/tests/torture/taint/a 
> b/coreutils-2026-10-18/./src/cat /proc/self/comm
> + fail=1

[...]

> +./tests/misc/proc-self-comm.sh: line 57: 
> /home/runner/work/ci-check/ci-check/coreutils/tests/torture/taint/a: Is a 
> directory

[...]

> I don't know which of the last 4 commits (in the last two days) is the
> cause.

It was a bug in my initial commit adding the tests. Evidently, I was not
thinking hard enough about the quoting. :)

I pushed the attached patch to fix it.

Thanks,
Collin

>From 056730f7ddda64c0e70bdd9c7dcc5f467bd6952f Mon Sep 17 00:00:00 2001
Message-ID: <056730f7ddda64c0e70bdd9c7dcc5f467bd6952f.1792372195.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Sun, 18 Oct 2026 17:43:23 -0700
Subject: [PATCH] tests: misc: fix a false failure in paths containing spaces

* tests/misc/proc-self-comm.sh: Quote variables that contain the current
working directory, which may contain spaces. Don't set symlink_cat to a
multi-argument command invocation. Set the path before executing it.
Reported by Bruno Haible.
---
 tests/misc/proc-self-comm.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/tests/misc/proc-self-comm.sh b/tests/misc/proc-self-comm.sh
index 538dd6f5e..31bd333ac 100755
--- a/tests/misc/proc-self-comm.sh
+++ b/tests/misc/proc-self-comm.sh
@@ -24,13 +24,12 @@ test -f /proc/self/comm || skip_ '/proc/self/comm is required'
 # Set up variables to execute 'cat' from its absolute path and,
 # if available, through the single binary.
 abs_cat=$(cmd_exe cat) || framework_failure_
-single_binary=$(cmd_exe coreutils) &&
-  single_binary_cat="$single_binary --coreutils-prog=cat"
+single_binary=$(cmd_exe coreutils)
 
-if test -n "$single_binary_cat" && ! $single_binary_cat /dev/null 2>err; then
+if test -n "$single_binary" &&
+    ! "$single_binary" --coreutils-prog=cat /dev/null 2>err; then
   grep "^coreutils: unknown program 'cat'$" err || framework_failure_
   single_binary=
-  single_binary_cat=
 fi
 
 mkdir dir || framework_failure_
@@ -39,7 +38,7 @@ mkdir dir || framework_failure_
 # up a symlink in the test directory to ensure this gets tested.
 if test -n "$single_binary" && ! test -L "$abs_cat"; then
   ln -s "$single_binary" dir/cat || framework_failure_
-  symlink_cat='env PATH='"$(pwd)/dir:$PATH"' cat'
+  symlink_cat=dir/cat
   # If we are using --enable-single-binary=shebangs, create a
   # binary to pretend we are using --program-prefix=g.
   if test $(wc -l < "$abs_cat") = 1; then
@@ -50,11 +49,17 @@ fi
 
 echo 'cat' >cat-exp || framework_failure_
 echo 'gcat' >gcat-exp || framework_failure_
-for prog in cat "$abs_cat" "$single_binary_cat" "$symlink_cat" "$gcat"; do
+for prog in cat "$abs_cat" "$single_binary" "$symlink_cat" "$gcat"; do
   test -z "$prog" && continue
   exp=cat-exp
   test "$prog" = "$gcat" && exp=gcat-exp
-  $prog /proc/self/comm >out 2>err || fail=1
+  single_binary_opt=
+  test "$prog" = "$single_binary" && single_binary_opt=--coreutils-prog=cat
+  if test "$prog" = "$symlink_cat"; then
+    env PATH="$(pwd)/dir:$PATH" cat /proc/self/comm >out 2>err || fail=1
+  else
+    "$prog" $single_binary_opt /proc/self/comm >out 2>err || fail=1
+  fi
   compare $exp out || fail=1
   compare /dev/null err || fail=1
 done
-- 
2.56.0

Reply via email to