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

Eric Blake eblake at redhat.com
Mon Feb 24 18:00:17 UTC 2014


On 02/24/2014 08:26 AM, Daniel P. Berrange wrote:
> 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.

I agree that this feels dirty; I think it would be better to fix
util/virstoragefile to not attempt to sanitize remote names (since right
now, all use of URIs are treated as remote names).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140224/1059afdd/attachment-0001.sig>


More information about the libvir-list mailing list