mirror of https://gitee.com/openkylin/libvirt.git
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…
Reference in New Issue