ovf import: disks: allow whitespaces in file path
Add a SAFE_CHAR_WITH_WHITESPACE_CLASS_RE sister variant of the shared SAFE_CHAR_CLASS_RE shared regex to the base storage module, this use case exist is a generic one after all, and use swap the untaint method that parses the file a disk references to it. Note that this is only the disk file name from inside the archive and thus during the extraction to a staging/working directory, from there it will be imported as volume allocated by the common storage system, and thus follow our ordinary volume name scheme. Improves disk detection when importing, e.g., the from upstream provided GNS3 OVA. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -108,6 +108,11 @@ my $tests = [
|
||||
volname => 'import/import.ova/disk.vmdk',
|
||||
expected => ['import', 'import.ova/disk.vmdk', undef, undef, undef, undef, 'ova+vmdk'],
|
||||
},
|
||||
{
|
||||
description => "Import, innner file of ova with whitespace in name",
|
||||
volname => 'import/import.ova/OS disk.vmdk',
|
||||
expected => ['import', 'import.ova/OS disk.vmdk', undef, undef, undef, undef, 'ova+vmdk'],
|
||||
},
|
||||
{
|
||||
description => "Import, innner file of ova",
|
||||
volname => 'import/import.ova/disk.raw',
|
||||
|
||||
Reference in New Issue
Block a user