[libvirt] Valid characters in domain names?

Matthias Bolte matthias.bolte at googlemail.com
Sat Oct 2 20:09:31 UTC 2010


2010/10/2 Richard W.M. Jones <rjones at redhat.com>:
> Does libvirt enforce any sort of validity of characters in guest names?
>
> Someone tried to create a domain called '#' (the single hash
> character) and noted that this caused failures in virt-tools:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=639601
> https://bugzilla.redhat.com/show_bug.cgi?id=639602
>
> Had a look at the code but couldn't see anything obvious: It seems
> like libvirt delegates this entirely to the drivers, the drivers
> (probably) all call virDomainDefParseXML, and this function does no
> checking that I could see.
>
> If my analysis is correct, this could be dangerous.  What if the name
> contains a character that is special to the qemu command line (','),
> to XML ('>'), or to C (&#x00;)?
>

Actually there are more places in libvirt that are prone to certain
characters in the domain name. The domain name is used as part of a
file name in several places. For example per-domain log files in
/var/log/libvirt/*/<domain name>.log will have trouble with a / in the
domain name.

Matthias




More information about the libvir-list mailing list