[libvirt] [PATCH] Fix URL-escaping for domainDefine

Philipp Hahn hahn at univention.de
Thu Sep 8 14:34:10 UTC 2011


'+' 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 at univention.de>
---
 src/xen/xend_internal.c |   62 
++++-------------------------------------------
 1 files changed, 5 insertions(+), 57 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-URL-escaping-for-domainDefine.patch
Type: text/x-patch
Size: 2194 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110908/6e1d306c/attachment-0001.bin>


More information about the libvir-list mailing list