From: Eric Blake Date: Wed, 10 Aug 2011 23:00:26 +0000 (-0600) Subject: virsh: fix snapshot-create-as to handle arbitrary names X-Git-Tag: v0.9.5-rc1~266 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6927887829f00ea61ab79432d89b029d0ff4fcf4;p=thirdparty%2Flibvirt.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. --- diff --git a/tools/virsh.c b/tools/virsh.c index b053ed07b4..d901d58e59 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -11963,9 +11963,9 @@ cmdSnapshotCreateAs(vshControl *ctl, const vshCmd *cmd) virBufferAddLit(&buf, "\n"); if (name) - virBufferAsprintf(&buf, " %s\n", name); + virBufferEscapeString(&buf, " %s\n", name); if (desc) - virBufferAsprintf(&buf, " %s\n", desc); + virBufferEscapeString(&buf, " %s\n", desc); virBufferAddLit(&buf, "\n"); buffer = virBufferContentAndReset(&buf);