From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5FFE1158074 for ; Sat, 28 Jun 2025 02:31:18 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 4D69C34103F for ; Sat, 28 Jun 2025 02:31:18 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id AF7E4110570; Sat, 28 Jun 2025 02:30:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id A09DD110570 for ; Sat, 28 Jun 2025 02:30:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 50472340ED3 for ; Sat, 28 Jun 2025 02:30:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 590F928E2 for ; Sat, 28 Jun 2025 02:30:36 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1751077822.370e2e82ede07e7699c718d6b984dd0d733657eb.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 370e2e82ede07e7699c718d6b984dd0d733657eb X-VCS-Branch: master Date: Sat, 28 Jun 2025 02:30:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4c6099f4-91c7-47d6-9573-7c9958ed5de2 X-Archives-Hash: 7c014b31b9f771b647774e3ecdae9d54 commit: 370e2e82ede07e7699c718d6b984dd0d733657eb Author: Kerin Millar plushkava net> AuthorDate: Fri Jun 27 07:21:04 2025 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jun 28 02:30:22 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=370e2e82 phase-functions.sh: correctly expand the positional parameters for has() Presently, the __filter_readonly_variables() function makes use of the has() function to determine whether various GNU-style long options have been specified. However, it expands the positional parameters as $*, potentially resulting in word splitting and unwanted pathname expansion. Address this issue by properly expanding them as "$@", duly rectifying five instances of SC2048. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/phase-functions.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index 860e28b987..b1bfa4a24e 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -121,23 +121,23 @@ __filter_readonly_variables() { filtered_vars+=" PORTDIR ECLASSDIR" fi - if has --filter-sandbox $* ; then + if has --filter-sandbox "$@"; then filtered_vars="${filtered_vars} SANDBOX_.*" else filtered_vars="${filtered_vars} ${filtered_sandbox_vars}" fi - if has --filter-features $* ; then + if has --filter-features "$@"; then filtered_vars="${filtered_vars} FEATURES PORTAGE_FEATURES" fi - if has --filter-path $* ; then + if has --filter-path "$@"; then filtered_vars+=" PATH" fi - if has --filter-locale $* ; then + if has --filter-locale "$@"; then filtered_vars+=" LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_PAPER LC_TIME" fi - if ! has --allow-extra-vars $* ; then + if ! has --allow-extra-vars "$@"; then if [[ "${EMERGE_FROM}" = binary ]]; then # preserve additional variables from build time, # while excluding untrusted variables