From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=jO3JA+VC; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 05C8F5A061E for ; Wed, 13 May 2026 02:40:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1778632852; bh=fmDNVPGEy4PXF7OZmtacVQrHwB08uuX63suvqS0ElxA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jO3JA+VC88aROa0bogq5urFcnkEiGT/Wo3B4/cYQpARyS/VOQh48l+X5hsJwMvqA9 IHjyfgHgdcTdkMIqPds3g+9IYKu+/LN6V0lEVTSe1pZssf5yobjXn+wIcRnjt8A9Y1 JSqNuRo9VCpHgM40e+hLpyPgQC4I43wVGhFGDEAd5ySA6ZkBaqpiF5P4ZFLp35av7w MCojD7sUXz56C/HhTgqo74z40kb2r2akMxU+MEz3O9NXIG3MgMjMR5hl2QljmXZNB1 m6OWDtwNM4yQOoFtYlL8y3UVAqLoaWTsRbmKavgfJG8HPiBjLwoyCU8SBPXlragPyC qemNGTo4flXww== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gFZPw6gKSz4wHt; Wed, 13 May 2026 10:40:52 +1000 (AEST) Date: Wed, 13 May 2026 10:40:46 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH] lib/term: Quote tr character ranges to prevent glob expansion Message-ID: References: <20260512095651.2365991-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="g1UN9LZsCyaApizx" Content-Disposition: inline In-Reply-To: <20260512095651.2365991-1-lvivier@redhat.com> Message-ID-Hash: WH7OALWBAUGPTYTAQYG5FGYB6WUPJTNN X-Message-ID-Hash: WH7OALWBAUGPTYTAQYG5FGYB6WUPJTNN X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --g1UN9LZsCyaApizx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 12, 2026 at 11:56:51AM +0200, Laurent Vivier wrote: > Single-letter files in the working directory cause glob expansion of > unquoted tr character ranges like [A-Z] and [a-z]. When the shell > expands these against matching filenames, tr receives wrong arguments > and pane_or_context_run() hangs without errors. >=20 > Apply the same fix as in a36031a4d807 ("seccomp.sh: Quote tr character > ranges to prevent glob expansion"): quote all tr ranges in test/lib/term. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > test/lib/term | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/test/lib/term b/test/lib/term > index 89e4fdbe591d..2d2d2182de14 100755 > --- a/test/lib/term > +++ b/test/lib/term > @@ -198,7 +198,7 @@ pane_run() { > # pane_wait() - Wait for command to be done in given pane name > # $1: Pane name > pane_wait() { > - __lc=3D"$(echo "${1}" | tr [A-Z] [a-z])" > + __lc=3D"$(echo "${1}" | tr '[A-Z]' '[a-z]')" > sleep 0.01 || sleep 1 > =20 > __done=3D0 > @@ -213,7 +213,7 @@ pane_wait() { > # pane_parse() - Print last line, @EMPTY@ if command had no output > # $1: Pane name > pane_parse() { > - __pane_lc=3D"$(echo "${1}" | tr [A-Z] [a-z])" > + __pane_lc=3D"$(echo "${1}" | tr '[A-Z]' '[a-z]')" > =20 > __buf=3D"$(tail -n2 ${LOGDIR}/pane_${__pane_lc}.log | head -n1 | sed 's= /^[^\r]*\r\([^\r]\)/\1/;s/=1B[]][^=1B]*=1B[\]//g' | tr -d '\r\n')" > =20 > @@ -267,7 +267,7 @@ pane_or_context_run() { > # Redirect stdin to stop ssh from eating the test instructions file we= have on stdin > context_run "${__name}" "$@" >/dev/null 2>&1 < /dev/null > else > - __uc=3D"$(echo "${__name}" | tr [a-z] [A-Z])" > + __uc=3D"$(echo "${__name}" | tr '[a-z]' '[A-Z]')" > pane_run "${__uc}" "$@" > pane_status "${__uc}" > fi > @@ -283,7 +283,7 @@ pane_or_context_run_bg() { > # Redirect stdin to stop ssh from eating the test instructions file we= have on stdin > context_run_bg "${__name}" "$@" >/dev/null 2>&1 < /dev/null > else > - __uc=3D"$(echo "${__name}" | tr [a-z] [A-Z])" > + __uc=3D"$(echo "${__name}" | tr '[a-z]' '[A-Z]')" > pane_run "${__uc}" "$@" > fi > } > @@ -303,7 +303,7 @@ pane_or_context_output() { > echo "${__output}" > fi > else > - __uc=3D"$(echo "${__name}" | tr [a-z] [A-Z])" > + __uc=3D"$(echo "${__name}" | tr '[a-z]' '[A-Z]')" > pane_run "${__uc}" "$@" > pane_wait "${__uc}" > pane_parse "${__uc}" > @@ -318,7 +318,7 @@ pane_or_context_wait() { > if context_exists "${__name}"; then > context_wait "${__name}" > else > - __uc=3D"$(echo "${__name}" | tr [a-z] [A-Z])" > + __uc=3D"$(echo "${__name}" | tr '[a-z]' '[A-Z]')" > pane_wait "${__uc}" > fi > } > --=20 > 2.54.0 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --g1UN9LZsCyaApizx Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmoDyH8ACgkQzQJF27ox 2GeO4BAAlnfac6qqAOULK50P+5EsVF44WViI6fM2t5Z9FmlOPOZG/HRPQ+WSjYUg iGmD08qp9wc91hRTPQIQ00hmo49geY/Hnhvj9Gp+Lcz6SB+IezwLwz0RTYkZMNyj t7Lux+5VTf8Fks6+OJLH6mitxXHbaPB7WfLrS9+Pw/PoGnqpUAIfwRMFM/pCH33m QtweJlQQyzaTcskBBVoKMYlcZFPIql/ZLkJx1ZKkUQuy0ZcqeUkpLMhD24NXfcZJ 99r2Hy1eE3RMO+JQREV28RruqTMKVWReqtkjSH1CMbuwWyBp8wgsvRZ+7lg2tFfp UB3ltYrdbOeh493vNVSNfr4GF2+vyjDG9ra+xAywlzxz0+LVxHK2KwQ5If5ngUTU MfNPfjWG7jDdqo7yFYTVsOQU1etmg+cQMpxT1ywcFRQ2NJb+b3ri/EqttuGwUZpM 4ewh9LYj8wqhUJdse/hEjy4+0v3NoYx0AqdVC0DYLIEllA+IFI7j5jc0VjrLPD1M 8tNN5zZU5P6eChHuTsmn/XGvlSa7KkdnE5Fs7BtdmpwMwcLC9Rr9ByQJk4PY+X8N aD6ijhlYXh3K979LuO5ljI5W9CGYW5MSu4zIwoUyz12Khqi2mBdsBQwx6CB8Xf/g d/XBGDRzN5uB/4Wt7ostoyLGkCjXuDrN+58OW1yEkC3NHTOUxhw= =AF0r -----END PGP SIGNATURE----- --g1UN9LZsCyaApizx--