]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix URL-escaping for domainDefine
authorPhilipp Hahn <hahn@univention.de>
Thu, 8 Sep 2011 14:34:10 +0000 (16:34 +0200)
committerDaniel Veillard <veillard@redhat.com>
Fri, 9 Sep 2011 07:18:39 +0000 (15:18 +0800)
commitb14e7d2a1662e7e07a471419e17dbae19bc574ca
treea448e1a9f303e78454361eec68f54873e848ec65
parent498d783387389bfd74437bf84374583f5a3d3bf6
Fix URL-escaping for domainDefine

'+' in strings get translated to ' ' when editing domains.
While xenDaemonDomainCreateXML() did URL-escape the sexpr,
xenDaemonDomainDefineXML() did not.

Remove the explicit urlencode() in xenDaemonDomainCreateXML() and add
the direct encoding calls to xend_op_ext() because it calls xend_post()
which uses "Content-Type: application/x-www-form-urlencoded". According
to <http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1> this
requires all parameters to be url-encoded as specified in rfc1738.

Notice: virBufferAsprintf(..., "%s=%s", ...) is again replaced by three
calls to virBufferURIEncodeString() and virBufferAddChar() because '='
is a "reserved" character, which would get escaped by
virBufferURIEncodeString(), which - by the way - escapes anything not
c_isalnum().

Signed-off-by: Philipp Hahn <hahn@univention.de>
src/xen/xend_internal.c