Skip to content

Commit 0bd45d1

Browse files
committed
Fix unquoted argument iteration in tfenv-exec.sh
Fix #453: Quote ${@} in for-loop to prevent word-splitting. "for _arg in ${@:1}" word-splits arguments containing spaces, breaking terraform commands that pass quoted arguments (e.g. terraform import with resource addresses containing brackets). Changed to "for _arg in "${@}"" which preserves argument boundaries.
1 parent fa8d238 commit 0bd45d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/tfenv-exec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function realpath-relative-to() {
2929
export -f realpath-relative-to;
3030

3131
function tfenv-exec() {
32-
for _arg in ${@:1}; do
32+
for _arg in "${@}"; do
3333
if [[ "${_arg}" == -chdir=* ]]; then
3434
chdir="${_arg#-chdir=}";
3535
log 'debug' "Found -chdir arg: ${chdir}";

0 commit comments

Comments
 (0)