mirror of
https://github.com/libvirt/libvirt.git
synced 2026-07-29 15:54:48 -05:00
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:
@@ -1,4 +1,4 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor unix:/tmp/test-monitor,server,\
|
||||
nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none \
|
||||
-parallel none -usb -vnc [2001:1:2:3:4:5:1234:1234]:3
|
||||
-parallel none -usb -vnc '[2001:1:2:3:4:5:1234:1234]:3'
|
||||
|
||||
Reference in New Issue
Block a user