From 9a38bb918681dbacac26ad160c9da23c4ccca067 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 6 Oct 2026 19:56:06 -0700 Subject: [PATCH] tests: misc: skip a test if the absolute top build dir is unsafe Without this change, this test would fail during 'make distcheck', for example. * tests/misc/exec-bad-unicode.sh: Skip the test if $abs_top_builddir has spaces or special characters. * cfg.mk (_tb_misc): Also match tests/misc/exec-bad-unicode.sh. Reported by Bruno Haible. --- cfg.mk | 2 +- tests/misc/exec-bad-unicode.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cfg.mk b/cfg.mk index 8fe20500d..83dc26f40 100644 --- a/cfg.mk +++ b/cfg.mk @@ -988,7 +988,7 @@ exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \ ^src/(system\.h|od\.c|printf\.c|getlimits\.c)$$ _cksum = ^tests/cksum/cksum-base64\.pl$$ -_tb_misc = misc/(stdbuf|responsive) +_tb_misc = misc/(exec-bad-unicode|stdbuf|responsive) exclude_file_name_regexp--sc_prohibit_test_backticks = \ ^tests/(local\.mk|(init|$(_tb_misc)|factor/create-test)\.sh)$$|$(_cksum) diff --git a/tests/misc/exec-bad-unicode.sh b/tests/misc/exec-bad-unicode.sh index 387d838bd..097305951 100755 --- a/tests/misc/exec-bad-unicode.sh +++ b/tests/misc/exec-bad-unicode.sh @@ -19,6 +19,15 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src +# stdbuf fails when the absolute top build dir name contains e.g., +# space, TAB, NL +lf=' +' +case $abs_top_builddir in + *[\\\"\#\$\&\'\`$lf\ \ ]*) + skip_ "unsafe absolute build directory name: $abs_top_builddir";; +esac + script="$(bad_unicode)" # Create a program with invalid Unicode in its name.