aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-06-06 06:05:11 +0200
committerUlrich Müller <ulm@gentoo.org>2023-06-06 17:50:32 +0200
commit65bb6ae01f359d82be453bf01a9e8f49171d8436 (patch)
treebba8d3e284c44bc2b6d34444b7903d41d15b7ef1
parentsetup.py: prepare for portage-3.0.48.1 (diff)
downloadportage-65bb6ae0.tar.gz
portage-65bb6ae0.tar.bz2
portage-65bb6ae0.zip
dosym: Prevent globbing of argument in dosym_canonicalize
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--NEWS4
-rwxr-xr-xbin/ebuild-helpers/dosym6
2 files changed, 7 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 8727e5623..09dd0675d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Bug fixes:
+* dosym: Prevent globbing of argument in dosym_canonicalize().
+
portage-3.0.48.1 (2023-06-06)
----------------
@@ -6,6 +9,7 @@ Bug fixes:
portage-3.0.48 (2023-06-01)
--------------
+
Breaking changes:
* Output deprecation warnings for portageq, prepstrip and prepallstrip
when they are called from an ebuild (bug #906129, bug #906156).
diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
index e41558a15..9ed27b8ce 100755
--- a/bin/ebuild-helpers/dosym
+++ b/bin/ebuild-helpers/dosym
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
@@ -33,7 +33,7 @@ if [[ ${option_r} ]]; then
dosym_canonicalize() {
local path slash i prev out IFS=/
- path=( ${1} )
+ read -r -d '' -a path <<< "${1}"
[[ ${1} == /* ]] && slash=/
while true; do
@@ -41,7 +41,7 @@ if [[ ${option_r} ]]; then
# or as a special case, "/.." at the beginning of the path.
# Also drop empty and "." path components as we go along.
prev=
- for i in ${!path[@]}; do
+ for i in "${!path[@]}"; do
if [[ -z ${path[i]} || ${path[i]} == . ]]; then
unset "path[i]"
elif [[ ${path[i]} != .. ]]; then