diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2016-08-12 10:52:30 +0200 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2017-05-10 15:27:55 -0400 |
commit | c7d6d5a6caa2befecb1bba83dfdac6cc0f749ac4 (patch) | |
tree | 16cf36432018404e521fa771a6c0d9320c1e06a1 | |
parent | 8123b6bc355a75772d07041196b970cea492f978 (diff) | |
download | libvirt-c7d6d5a6caa2befecb1bba83dfdac6cc0f749ac4.tar.gz |
schema: Don't validate paths
https://bugzilla.redhat.com/show_bug.cgi?id=1353296
On UNIX like systems there are no constraints on what characters
can be in file/dir names (except for NULL, obviously). Moreover,
some values that we think of as paths (e.g. disk source) are not
necessarily paths at all. For instance, some hypervisors take
that as an arbitrary identifier and corresponding file is then
looked up by hypervisor in its table. Instead of trying to fix
our regular expressions (and forgetting to include yet another
character there), lets drop the validation completely.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit c4b92f1a8a9cb64a2c4a9f0ed899ed8a7d95d935)
-rw-r--r-- | docs/schemas/basictypes.rng | 8 | ||||
-rw-r--r-- | tests/domainschemadata/domain-disk-source-space.xml | 36 |
2 files changed, 40 insertions, 4 deletions
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index a83063afcc..12cab6a3ee 100644 --- a/docs/schemas/basictypes.rng +++ b/docs/schemas/basictypes.rng @@ -230,25 +230,25 @@ <define name="filePath"> <data type="string"> - <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/%]+</param> + <param name="pattern">.+</param> </data> </define> <define name="dirPath"> <data type="string"> - <param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/%]+</param> + <param name="pattern">.+</param> </data> </define> <define name="absFilePath"> <data type="string"> - <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,:]+</param> + <param name="pattern">/.+</param> </data> </define> <define name="absDirPath"> <data type="string"> - <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%]*</param> + <param name="pattern">/.*</param> </data> </define> diff --git a/tests/domainschemadata/domain-disk-source-space.xml b/tests/domainschemadata/domain-disk-source-space.xml new file mode 100644 index 0000000000..553b6c7f01 --- /dev/null +++ b/tests/domainschemadata/domain-disk-source-space.xml @@ -0,0 +1,36 @@ +<domain type='kvm'> + <name>dummy</name> + <uuid>aa86471a-e67b-41b1-8d7d-2dc37c2ac5ec</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type> + </os> + <features> + <acpi/> + <apic/> + </features> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <pm> + <suspend-to-mem enabled='no'/> + <suspend-to-disk enabled='no'/> + </pm> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <source file='/a/path/with some space in it.iso'/> + <target dev='hda' bus='ide'/> + <readonly/> + <boot order='1'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='pci' index='0' model='pci-root'/> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + </devices> +</domain> |