Bug #14224

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

Added by Tom Clegg over 2 years ago. Updated over 2 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*'
*    *

Associated revisions

Revision 06454ba2 (diff)
Added by Michał Kłobukowski over 2 years ago

Make use of ahell-quote lib in command window, add copy command button

Feature #14224

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <>

Revision b10a9471
Added by Michał Kłobukowski over 2 years ago

Merge branch '14224-correct-shell-quoting'

refs #14224

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <>

History

#1 Updated by Chrystian Klingenberg over 2 years ago

  • Target version set to sprint 9

#2 Updated by Chrystian Klingenberg over 2 years ago

  • Story points set to 1.0

#3 Updated by Michał Kłobukowski over 2 years ago

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

#4 Updated by Michał Kłobukowski over 2 years ago

  • Status changed from In Progress to Resolved

#5 Updated by Michal Komorowski over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF