Project

General

Profile

Actions

Bug #14224

closed

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

Added by Tom Clegg almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Story points:
1.0

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 almost 4 years ago

  • Target version set to sprint 9
Actions #2

Updated by Chrystian Klingenberg almost 4 years ago

  • Story points set to 1.0
Actions #3

Updated by Michał Kłobukowski almost 4 years ago

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

Updated by Michał Kłobukowski almost 4 years ago

  • Status changed from In Progress to Resolved
Actions #5

Updated by Michal Komorowski almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF