Re: [PATCH 2/3] util: file: Don't sanitize URI protocol separator in virFileSanitizePath

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

 



On Mon, Feb 24, 2014 at 04:21:47PM +0100, Peter Krempa wrote:
> The function removes multiple following slashes from paths. This is okay
> unless you try to sanitize a URI this way. Skip the protocol definition
> until "://"  and sanitize just the path part.
> 
> The sanitization function is used in virStorageVolLookupByPath as the
> first step before passing the path to storage drivers. This breaks
> lookup of gluster volumes.
> ---
>  src/util/virfile.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

This feels a rather dirty to me - we shouldn't be trying to second
guess whether a filename might be a URI.

I think we should not be passing URIs to the virFileSanitizePath in
the first place.  Based on what you say about usage, it sounds like
the call to virFileSanitizePath needs to be pushed down into the
storage backend drivers themselves.

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

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