diff options
author | Ulrich Müller <ulm@gentoo.org> | 2023-06-06 06:05:11 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2023-06-06 17:50:32 +0200 |
commit | 65bb6ae01f359d82be453bf01a9e8f49171d8436 (patch) | |
tree | bba8d3e284c44bc2b6d34444b7903d41d15b7ef1 /bin | |
parent | setup.py: prepare for portage-3.0.48.1 (diff) | |
download | portage-65bb6ae01f359d82be453bf01a9e8f49171d8436.tar.gz portage-65bb6ae01f359d82be453bf01a9e8f49171d8436.tar.bz2 portage-65bb6ae01f359d82be453bf01a9e8f49171d8436.zip |
dosym: Prevent globbing of argument in dosym_canonicalize
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ebuild-helpers/dosym | 6 |
1 files changed, 3 insertions, 3 deletions
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 |