automation: avoid globbering the docker run args
authorOlaf Hering <olaf@aepfle.de>
Thu, 8 Jul 2021 14:56:49 +0000 (16:56 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 9 Jul 2021 12:28:52 +0000 (13:28 +0100)
containerize bash -c './configure && make' fails due to shell expansion.

Collect all arguments for the script and pass them verbatim to the
docker run command.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andrew Cooper <andew.cooper3@citrix.com>
automation/scripts/containerize

index 59edf0ba40571a6715ae032821c1448c6cd7836a..7682ccd3475942c0c4c2edc065958896ba4ccf9e 100755 (executable)
@@ -47,10 +47,10 @@ case "_${CONTAINER_UID0}" in
 esac
 
 # Save the commands for future use
-cmd=$@
+cmd=("$@")
 
 # If no command was specified, just drop us into a shell if we're interactive
-[ $# -eq 0 ] && tty -s && cmd="/bin/bash"
+[ $# -eq 0 ] && tty -s && cmd=("/bin/bash")
 
 # Are we in an interactive terminal?
 tty -s && termint=t
@@ -104,4 +104,4 @@ exec ${docker_cmd} run \
     ${CONTAINER_ARGS} \
     -${termint}i --rm -- \
     ${CONTAINER} \
-    ${cmd}
+    "${cmd[@]}"