Valid characters in domain names?

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

 



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 (�)?

As an example, the code already does:

char *virDomainDefFormat(virDomainDefPtr def,
                         int flags)
{
  ...
  virBufferEscapeString(&buf, "  <name>%s</name>\n", def->name);
  ...
}

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/

--
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]