[libvirt] [PATCH] storage: Sanitize pool target paths

Eric Blake eblake at redhat.com
Thu May 20 16:34:28 UTC 2010


On 05/20/2010 10:19 AM, Daniel P. Berrange wrote:
> On Thu, May 20, 2010 at 12:04:05PM -0400, Cole Robinson wrote:
>> Spurious / in a pool target path makes life difficult for apps using the
>> GetVolByPath, and doing other path based comparisons with pools. This
>> has caused a few issues for virt-manager users:
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=494005
>> https://bugzilla.redhat.com/show_bug.cgi?id=593565
>>
>> Add a new util API which removes spurious /, virFileSanitizePath. Sanitize
>> target paths when parsing pool XML, and for paths passed to GetVolByPath.
> 
> If we're going todo this shouldn't we resolve symlinks, and
> canonicalize any '..' or '.' components in the path. IIRC
> gnulib had something for this ?

Gnulib has canonicalize-lgpl, but that only succeeds on existing file
names.  If you want to canonicalize a name without regards to existence,
there is canonicalize(), but it is GPL, so we can't use it. :(

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list