]> git.ipfire.org Git - thirdparty/libvirt.git/commit
command: shell-quote when logging commands
authorEric Blake <eblake@redhat.com>
Tue, 28 Aug 2012 18:11:45 +0000 (11:11 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 31 Aug 2012 15:10:58 +0000 (08:10 -0700)
commit54e99644bf89dc36d9d4b3f7dc57c157ff78a0e3
tree0a4efa090e54213593d62a0b72d76b924f802fdb
parent67f83cd497f277775d7fa519176d0e89546d668b
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.
src/util/command.c
tests/commanddata/test16.log
tests/commandtest.c
tests/networkxml2argvdata/nat-network-dns-txt-record.argv
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth.args
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.args
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.args
tests/qemuxml2argvdata/qemuxml2argv-smbios.args