From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Xsi4RjYH; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id C6B7A5A0262 for ; Tue, 12 May 2026 11:56:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778579815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=anyLKOQz0JuiEsZHpFmlQga5qMfeumbhX1kfF9dooho=; b=Xsi4RjYH5Nt4791p+/kLYwClCsHFdgbJ9g2bvgQcqsKc2a8jrqMm+IidtEsysztbBeU6Yd 7JkK9eItFvP0vyqy139QXbW+LCDbkNPJ0RoVacS+5bxiwWjfFH7qcDj1ip3IEB21Cc5zX7 ALYGriykg/XdUsSBsnWiGMgIJ7xnu/s= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-e6nH1LoeOhKZBpoKnR2lGw-1; Tue, 12 May 2026 05:56:54 -0400 X-MC-Unique: e6nH1LoeOhKZBpoKnR2lGw-1 X-Mimecast-MFC-AGG-ID: e6nH1LoeOhKZBpoKnR2lGw_1778579813 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 73B97195609D for ; Tue, 12 May 2026 09:56:53 +0000 (UTC) Received: from lenovo-t14s.redhat.corp (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AAADD1955D84; Tue, 12 May 2026 09:56:52 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH] lib/term: Quote tr character ranges to prevent glob expansion Date: Tue, 12 May 2026 11:56:51 +0200 Message-ID: <20260512095651.2365991-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cAecyhgYz-y--ToCdEgc19SHUU7eYrgo30EXI4tXg-A_1778579813 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: 7EYKLQQ6JEXDSB3TLZ6C2DTMKW7HSIRN X-Message-ID-Hash: 7EYKLQQ6JEXDSB3TLZ6C2DTMKW7HSIRN X-MailFrom: lvivier@redhat.com 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: Laurent Vivier 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: 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. 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. Signed-off-by: Laurent Vivier --- test/lib/term | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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="$(echo "${1}" | tr [A-Z] [a-z])" + __lc="$(echo "${1}" | tr '[A-Z]' '[a-z]')" sleep 0.01 || sleep 1 __done=0 @@ -213,7 +213,7 @@ pane_wait() { # pane_parse() - Print last line, @EMPTY@ if command had no output # $1: Pane name pane_parse() { - __pane_lc="$(echo "${1}" | tr [A-Z] [a-z])" + __pane_lc="$(echo "${1}" | tr '[A-Z]' '[a-z]')" __buf="$(tail -n2 ${LOGDIR}/pane_${__pane_lc}.log | head -n1 | sed 's/^[^\r]*\r\([^\r]\)/\1/;s/[]][^]*[\]//g' | tr -d '\r\n')" @@ -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="$(echo "${__name}" | tr [a-z] [A-Z])" + __uc="$(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="$(echo "${__name}" | tr [a-z] [A-Z])" + __uc="$(echo "${__name}" | tr '[a-z]' '[A-Z]')" pane_run "${__uc}" "$@" fi } @@ -303,7 +303,7 @@ pane_or_context_output() { echo "${__output}" fi else - __uc="$(echo "${__name}" | tr [a-z] [A-Z])" + __uc="$(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="$(echo "${__name}" | tr [a-z] [A-Z])" + __uc="$(echo "${__name}" | tr '[a-z]' '[A-Z]')" pane_wait "${__uc}" fi } -- 2.54.0