From: Brett Smith Date: Wed, 6 Apr 2016 15:37:12 +0000 (-0400) Subject: Merge branch '8893-crunch-job-crunchrunner-quoting-wip' X-Git-Tag: 1.1.0~1010 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/9c3a1a10b702ec7ee79bb0aa1beb3c227bec95dd?hp=b8ae9ce66c24055f3bf66b0956e15c44c9dd51f0 Merge branch '8893-crunch-job-crunchrunner-quoting-wip' Closes #8893, #8895. --- diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job index cc0b60c475..6423c1cf79 100755 --- a/sdk/cli/bin/crunch-job +++ b/sdk/cli/bin/crunch-job @@ -853,9 +853,12 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++) .q{&& SWAP=$(awk '($1 == "SwapTotal:"){print $2}' /dev/null ; then VOLUME_CRUNCHRUNNER=\"--volume=\$(which crunchrunner):/usr/local/bin/crunchrunner\" ; fi " - ."&& if test -f /etc/ssl/certs/ca-certificates.crt ; then VOLUME_CERTS=\"--volume=/etc/ssl/certs/ca-certificates.crt:/etc/arvados/ca-certificates.crt\" ; fi " - ."&& if test -f /etc/pki/tls/certs/ca-bundle.crt ; then VOLUME_CERTS=\"--volume=/etc/pki/tls/certs/ca-bundle.crt:/etc/arvados/ca-certificates.crt\" ; fi "; + # $VOLUME_CRUNCHRUNNER and $VOLUME_CERTS will be passed unquoted as + # arguments to `docker run`. They must contain their own quoting. + .q{&& VOLUME_CRUNCHRUNNER="" VOLUME_CERTS="" } + .q{&& if which crunchrunner >/dev/null ; then VOLUME_CRUNCHRUNNER=\\"--volume=$(which crunchrunner):/usr/local/bin/crunchrunner\\" ; fi } + .q{&& if test -f /etc/ssl/certs/ca-certificates.crt ; then VOLUME_CERTS=\\"--volume=/etc/ssl/certs/ca-certificates.crt:/etc/arvados/ca-certificates.crt\\" ; } + .q{elif test -f /etc/pki/tls/certs/ca-bundle.crt ; then VOLUME_CERTS=\\"--volume=/etc/pki/tls/certs/ca-bundle.crt:/etc/arvados/ca-certificates.crt\\" ; fi }; $command .= "&& exec arv-mount --read-write --mount-by-pdh=by_pdh --mount-tmp=tmp --crunchstat-interval=10 --allow-other $arv_file_cache \Q$keep_mnt\E --exec "; $ENV{TASK_KEEPMOUNT} = "$keep_mnt/by_pdh"; @@ -922,7 +925,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++) # Bind mount the crunchrunner binary and host TLS certificates file into # the container. - $command .= "\"\$VOLUME_CRUNCHRUNNER\" \"\$VOLUME_CERTS\" "; + $command .= "\$VOLUME_CRUNCHRUNNER \$VOLUME_CERTS "; while (my ($env_key, $env_val) = each %ENV) {