[libvirt] Which symbols can be used in file paths in libvirt's XMLs?

Daniel P. Berrange berrange at redhat.com
Wed Jul 1 16:36:11 UTC 2015


On Wed, Jul 01, 2015 at 07:22:33PM +0300, Dmitry Guryanov wrote:
> Hello,
> 
> There is an absFilePatch type in docs/schemas/basictypes.rng rng schema:
> 
>   <define name="absFilePath">
>     <data type="string">
>       <param
> name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,:]+</param>
>     </data>
>   </define>
> 
> There are quite few symbols in this set of the ones, which linux allows to
> have in file paths. For example spaces or curly braces are not allowed.
> There are a lot of elements of this type in other rng schems, for example:

[snip]

> So the question is, where did this path pattern come from? Is it possible to
> use file paths with another symbols or there will be some problems?

I think this regex pattern is a bit of a misguided attempt to perform
semantic validation on the XML content. I'd probably be inclined to
simplify it to '/.*' and just delegate all other validation to drivers
as they desire.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list