diff options
author | Luke Bakken <[email protected]> | 2017-10-30 10:44:27 -0700 |
---|---|---|
committer | Luke Bakken <[email protected]> | 2017-10-30 10:44:27 -0700 |
commit | 19ae6a4c98a131aab84ed9922c307ab3f0eebec7 (patch) | |
tree | 3bc596e2f22788a6176891668a61a4577bbb98c6 /priv | |
parent | 6e149058b5b92a2f9134c625fce0849a8af15c1f (diff) | |
download | relx-19ae6a4c98a131aab84ed9922c307ab3f0eebec7.tar.gz relx-19ae6a4c98a131aab84ed9922c307ab3f0eebec7.tar.bz2 relx-19ae6a4c98a131aab84ed9922c307ab3f0eebec7.zip |
Add test that demonstrates that fixes preserve an argument that contains both double quotes and a space character
Diffstat (limited to 'priv')
-rwxr-xr-x | priv/templates/extended_bin | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin index 8bd9726..0482359 100755 --- a/priv/templates/extended_bin +++ b/priv/templates/extended_bin @@ -460,10 +460,10 @@ case "$1" in HEART_OPTION="start_boot" ;; esac - RUN_PARAM="$(printf "\'%s\' " "$@")" + ARGS="$(printf "\'%s\' " "$@")" # Export the HEART_COMMAND - HEART_COMMAND="$RELEASE_ROOT_DIR/bin/$REL_NAME $HEART_OPTION $RUN_PARAM" + HEART_COMMAND="\"$RELEASE_ROOT_DIR/bin/$REL_NAME\" \"$HEART_OPTION\" $ARGS" export HEART_COMMAND test -z "$PIPE_BASE_DIR" || mkdir -m 1777 -p "$PIPE_BASE_DIR" @@ -471,7 +471,7 @@ case "$1" in relx_run_hooks "$PRE_START_HOOKS" "$BINDIR/run_erl" -daemon "$PIPE_DIR" "$RUNNER_LOG_DIR" \ - "exec $RELEASE_ROOT_DIR/bin/$REL_NAME $START_OPTION $RUN_PARAM" + "exec \"$RELEASE_ROOT_DIR/bin/$REL_NAME\" \"$START_OPTION\" $ARGS" relx_run_hooks "$POST_START_HOOKS" ;; @@ -623,20 +623,13 @@ case "$1" in export EMU export PROGNAME - # Store passed arguments since they will be erased by `set` - ARGS="$@" - - # Build an array of arguments to pass to exec later on - # Build it here because this command will be used for logging. - set -- "$BINDIR/erlexec" $FOREGROUNDOPTIONS \ + # Dump environment info for logging purposes + echo "Exec: $BINDIR/erlexec" $FOREGROUNDOPTIONS \ -boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \ -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \ -config "$RELX_CONFIG_PATH" \ -args_file "$VMARGS_PATH" \ - -pa ${__code_paths} - - # Dump environment info for logging purposes - echo "Exec: $@" -- ${1+$ARGS} + -pa ${__code_paths} -- "$@" echo "Root: $ROOTDIR" # Log the startup @@ -644,7 +637,12 @@ case "$1" in logger -t "$REL_NAME[$$]" "Starting up" # Start the VM - exec "$@" -- ${1+$ARGS} + exec "$BINDIR/erlexec" $FOREGROUNDOPTIONS \ + -boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \ + -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \ + -config "$RELX_CONFIG_PATH" \ + -args_file "$VMARGS_PATH" \ + -pa ${__code_paths} -- "$@" ;; rpc) # Make sure a node IS running |