mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests: quote tr character classes in runner.sh
@ 2026-11-16 14:27 Jori Koolstra (CIQ)
  2026-11-16 18:55 ` Ricardo B. Marlière (SUSE)
  0 siblings, 1 reply; 2+ messages in thread
From: Jori Koolstra (CIQ) @ 2026-11-16 14:27 UTC (permalink / raw)
  To: Shuah Khan, Cristian Marussi
  Cc: Shuah Khan, linux-kselftest, linux-kernel, Jori Koolstra (CIQ)

The unquoted [:lower:] and [:upper:] arguments are subject to
pathname expansion, so a single-character file such as 'l' or 'r'
in the current directory would replace them and break the
KSELFTEST_<TEST>_ARGS name sanitization. Quote them like the other
tr invocations.

Fixes: e005ff01bfdb ("selftests/kselftest/runner.sh: Pass optional command parameters in environment")

Signed-off-by: Jori Koolstra (CIQ) <jkoolstra@xs4all.nl>
---
 tools/testing/selftests/kselftest/runner.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
index 311811dc55a0..e81a35e607da 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -77,7 +77,7 @@ run_one()
 		BASENAME_SANITIZED=$(echo "$BASENAME_TEST" | \
 					$TR_CMD -d "[:blank:][:cntrl:]" | \
 					$TR_CMD -c "[:alnum:]_" "_" | \
-					$TR_CMD [:lower:] [:upper:])
+					$TR_CMD "[:lower:]" "[:upper:]")
 		kselftest_cmd_args_ref="KSELFTEST_${BASENAME_SANITIZED}_ARGS"
 	fi
 

---
base-commit: 4d038dae9e5ba5b3fec87fad5b7bf3dc45523ca1
change-id: 20261116-kselftest-runner-quote-tr-467bb5fe6dac

Best regards,
-- 
Jori Koolstra (CIQ) <jkoolstra@xs4all.nl>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-16 18:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 14:27 [PATCH] selftests: quote tr character classes in runner.sh Jori Koolstra (CIQ)
2026-11-16 18:55 ` Ricardo B. Marlière (SUSE)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®