mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: fix snapshot-create-as to handle arbitrary names
Found this working on the next patch to use xpath to parse arbitrary names back out. * tools/virsh.c (cmdSnapshotCreateAs): Escape user input.
This commit is contained in:
@@ -11963,9 +11963,9 @@ cmdSnapshotCreateAs(vshControl *ctl, const vshCmd *cmd)
|
||||
|
||||
virBufferAddLit(&buf, "<domainsnapshot>\n");
|
||||
if (name)
|
||||
virBufferAsprintf(&buf, " <name>%s</name>\n", name);
|
||||
virBufferEscapeString(&buf, " <name>%s</name>\n", name);
|
||||
if (desc)
|
||||
virBufferAsprintf(&buf, " <description>%s</description>\n", desc);
|
||||
virBufferEscapeString(&buf, " <description>%s</description>\n", desc);
|
||||
virBufferAddLit(&buf, "</domainsnapshot>\n");
|
||||
|
||||
buffer = virBufferContentAndReset(&buf);
|
||||
|
||||
Reference in New Issue
Block a user