xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] automation: avoid globbering the docker run args
@ 2021-07-08 14:56 Olaf Hering
  2021-07-09 11:48 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Olaf Hering @ 2021-07-08 14:56 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering, Doug Goldstein

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>
---
 automation/scripts/containerize | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 59edf0ba40..7682ccd347 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -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[@]}"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] automation: avoid globbering the docker run args
  2021-07-08 14:56 [PATCH v1] automation: avoid globbering the docker run args Olaf Hering
@ 2021-07-09 11:48 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2021-07-09 11:48 UTC (permalink / raw)
  To: Olaf Hering, xen-devel; +Cc: Doug Goldstein

On 08/07/2021 15:56, Olaf Hering wrote:
> 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>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-09 11:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 14:56 [PATCH v1] automation: avoid globbering the docker run args Olaf Hering
2021-07-09 11:48 ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).