Project

General

Profile

Actions

Bug #14224

closed

[Bug][Running a workflow] Correct shell quoting in command modal

Added by Tom Clegg over 6 years ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Story points:
1.0
Release relationship:
Auto

Description

Each element of the command array in a container request is one argument to exec, even if it contains spaces. Joining the elements with a space separator loses the distinction between spaces in arguments and spaces between arguments.

Suggest shell-quoting/escaping array elements that contain spaces and other special characters, to produce a string that is unambiguous and can be pasted into a shell prompt.

Examples:

command (JSON-encoded) one possible shell-escaped version output
["sh", "-c", "echo $0", "OK"] sh -c "echo \$0" OK
OK
["sh", "-c", "echo $(printf %s \"'\"'\"'\\\\ | md5sum | head -c8)"] sh -c echo\ \$\(printf\ %s\ \"\'\"\'\"\'\\\\\ \|\ md5sum\ \|\ head\ -c8\)
9a33fb47
["sh", "-c", "echo $(printf %s \"'\"'\"'\\\\ | md5sum | head -c8)"] sh -c $'echo $(printf %s \"\'\"\'\"\'\\\\ | md5sum | head -c8)'
9a33fb47
["echo", "*\u0009*"] echo '*\t*'
*    *
Actions #1

Updated by Chrystian Klingenberg over 6 years ago

  • Target version set to sprint 9
Actions #2

Updated by Chrystian Klingenberg over 6 years ago

  • Story points set to 1.0
Actions #3

Updated by Michał Kłobukowski over 6 years ago

  • Status changed from New to In Progress
  • Assigned To set to Michał Kłobukowski
Actions #4

Updated by Michał Kłobukowski over 6 years ago

  • Status changed from In Progress to Resolved
Actions #5

Updated by Michal Komorowski about 6 years ago

  • Status changed from Resolved to Closed
Actions #6

Updated by Peter Amstutz 8 months ago

  • Release set to 15
Actions

Also available in: Atom PDF