libvirt/tests/storagepoolxml2xmlin/pool-dir.xml
Cole Robinson a7fb2258ca storage: Sanitize pool target paths
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.

v2: Leading // must be preserved, properly sanitize path=/, sanitize
    away /./ -> /

v3: Properly handle starting ./ and ending /.

v4: Drop all '.' handling, just sanitize / for now.
2010-05-25 12:30:44 -04:00

19 lines
421 B
XML

<pool type='dir'>
<name>virtimages</name>
<uuid>70a7eb15-6c34-ee9c-bf57-69e8e5ff3fb2</uuid>
<capacity>0</capacity>
<allocation>0</allocation>
<available>0</available>
<source>
</source>
<target>
<path>///var/////lib/libvirt/images//</path>
<permissions>
<mode>0700</mode>
<owner>0</owner>
<group>0</group>
<label>some_label_t</label>
</permissions>
</target>
</pool>