mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00: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:
parent
0de75e855b
commit
6927887829
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user