Re: XML escaping patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 06, 2007 at 03:06:37PM +0100, Daniel P. Berrange wrote:
> So instead of that we could do
> 
>     dom =  xmlRootElement("domain")
>     xmlAttributeInt(dom, "id", id);
>     xmlAttributeString(dom, "type", "xen");
> 
>     os = xmlElement(dom, "os")
>     xmlElementString(os, "bootloader", tmp)
>   
>     char *doc = xmlString(dom);
>     xmlFree(dom);
>     return doc;

  We could create intermediate functions around libxml2 tree API, 
but it would still be a bit more heavy than that. 

> Of course this is a much large change than the one you're suggesting. We
> surely need to fixup much more than the two 'cmdline' and 'bootloader_args'
> elements that you describe - practically any element / attribute which
> takes a %s format string needs this fix.

  Well would a name with < > or & actually work ? A path would not,
most attributes are predefined strings values which are just ascii name
token, that would probably be a bit over the top, no ?

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard@xxxxxxxxxx  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]