From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 17A2215806E for ; Mon, 5 Jun 2023 18:34:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB50EE0886; Mon, 5 Jun 2023 18:34:14 +0000 (UTC) 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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AE43AE0886 for ; Mon, 5 Jun 2023 18:34:14 +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 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9DD0C340E7F for ; Mon, 5 Jun 2023 18:34:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 922F38DC for ; Mon, 5 Jun 2023 18:34:11 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1685987222.58e82125a8adfa89585468f3e6609f46896d313a.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: bin/, / X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog bin/eselect.in X-VCS-Directories: bin/ / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 58e82125a8adfa89585468f3e6609f46896d313a X-VCS-Branch: master Date: Mon, 5 Jun 2023 18:34:11 +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: 8db59454-4271-4567-b1cc-d233036dc551 X-Archives-Hash: 9c2268e1a3074830ae793403a6861923 commit: 58e82125a8adfa89585468f3e6609f46896d313a Author: Ulrich Müller gentoo org> AuthorDate: Mon Jun 5 17:47:02 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Mon Jun 5 17:47:02 2023 +0000 URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=58e82125 Quote argument of ":" command * bin/eselect.in (EPREFIX): Quote argument of ":" command. This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223 Add some more quotes throughout. Signed-off-by: Ulrich Müller gentoo.org> ChangeLog | 6 ++++++ bin/eselect.in | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index afa6885..701fb9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-06-05 Ulrich Müller + + * bin/eselect.in (EPREFIX): Quote argument of ":" command. + This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223 + Add some more quotes throughout. + 2023-06-04 Ulrich Müller * doc/developer-guide.txt: Add subsection about module testing. diff --git a/bin/eselect.in b/bin/eselect.in index 9109627..c59a09d 100755 --- a/bin/eselect.in +++ b/bin/eselect.in @@ -45,7 +45,7 @@ ESELECT_KILL_TARGET="$$" # prefix for the build host. EPREFIX defaults to the same, but can be # overridden at runtime when building for a different prefix. BROOT="@EPREFIX@" -: ${EPREFIX="${BROOT}"} +: "${EPREFIX="${BROOT}"}" EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}" # Remove all alias definitions. Unset functions and variables that are @@ -126,7 +126,7 @@ unset suffix if [[ -z ${action} ]]; then binname=$(basename "$0") for prefix in config update{,r} manage 'read'; do - if [[ ${binname##${prefix}-} != ${binname} ]]; then + if [[ ${binname##${prefix}-} != "${binname}" ]]; then action=$(basename "$0") action=${action##${prefix}-} break @@ -145,7 +145,7 @@ while [[ ${1##--} != "$1" ]]; do colour=*|color=*|colour|color) # accept all arguments that are valid for ls or emerge case ${1#*=} in - yes|y|always|force|$1) colour=yes ;; + yes|y|always|force|"$1") colour=yes ;; no|n|never|none) colour=no ;; auto|tty|if-tty) colour="" ;; *) die -q "Invalid argument for ${1%%=*} option" ;;