[libvirt] [PATCH] fix up dom-name validation

libvirt schema: improve domain name regex This regexp is based upon what xend actually allows, plus the existing &, which I presume is there for a reason. Signed-off-by: John Levon <john.levon> Index: docs/libvirt.rng =================================================================== RCS file: /data/cvs/libvirt/docs/libvirt.rng,v retrieving revision 1.8 diff -u -r1.8 libvirt.rng --- docs/libvirt.rng 8 Jul 2008 12:05:13 -0000 1.8 +++ docs/libvirt.rng 10 Jul 2008 04:04:58 -0000 @@ -840,7 +840,7 @@ </define> <define name='domainName'> <data type='string'> - <param name="pattern">[a-zA-Z0-9_\+\-&]+</param> + <param name="pattern">[A-Za-z0-9_.:/\+\-&-]+</param> </data> </define> <define name='genericName'>

On Thu, Jul 10, 2008 at 05:07:07AM +0100, John Levon wrote:
libvirt schema: improve domain name regex
Cool, thanks, applied !
This regexp is based upon what xend actually allows, plus the existing &, which I presume is there for a reason.
Hum, well, I used that to make sure names characters were properly escaped too when converting to XML. Actually in practice & is unlikely (though other hypervisors than Xen may allow that character) and other XML escaped characters are even less likely because they would be a major pain to use from a command line level, but I would prefer to keep that test case (tests/xmconfigdata/test-escape-paths.cfg and xml). Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Daniel Veillard
-
John Levon