提交 69278878 编写于 作者: E Eric Blake

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.
上级 0de75e85
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册