command: shell-quote when logging commands

Without this patch, logged command executions can be ambiguous if
the command contained any shell metacharacters.  This has caused
more than one person to attempt to patch clients to add unnecessary
quoting, without realizing that the command itself was run with
correct args, and only the logged output was ambiguous.

* src/util/command.c (virCommandToString): Add shell escapes.
* tests/commandtest.c (test16): Test new behavior.
* tests/commanddata/test16.log: Update expected output.
* tests/qemuxml2argvdata/qemuxml2argv-*.args: Likewise.
* tests/networkxml2argvdata/*.argv: Likewise.
This commit is contained in:
Eric Blake
2012-08-28 11:11:45 -07:00
parent 67f83cd497
commit 54e99644bf
9 changed files with 38 additions and 21 deletions

View File

@@ -1 +1 @@
A=B true C
A=B C=D E true F G H