[libvirt] [PATCH] Strip control codes in virBufferEscapeString

Eric Blake eblake at redhat.com
Mon Mar 30 16:56:11 UTC 2015


On 03/30/2015 09:50 AM, Daniel Veillard wrote:

>> NACK.  Stripping control codes from a volume name represents the wrong
>> name.  We need to escape the problematic bytes, rather than strip them.
> 
>   you can't escape them with a CharRef for sure
> 
> http://www.w3.org/TR/REC-xml/#wf-Legalchar
> Characters referred to using character references must match the
> production for Char.
> 
>   That time Ján  is right :-)

Ouch.  Then how do we represent the name of a storage volume, when the
file system allows arbitrary bytes including control characters, in the
volume name, but where we are restricted to only using valid XML?  Do we
just silently ignore such files as impossible volumes that libvirt
cannot manage?  (I'd rather omit such a volume from the list in the
pool, than silently munge its name into something incorrect)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150330/95cd0e57/attachment-0001.sig>


More information about the libvir-list mailing list