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:
@ -119,8 +119,9 @@ our $IMPORT_EXT_RE_1 = qr/\.(ova|ovf|qcow2|raw|vmdk)/;
|
||||
our $UPLOAD_IMPORT_EXT_RE_1 = qr/\.(ova)/;
|
||||
|
||||
our $SAFE_CHAR_CLASS_RE = qr/[a-zA-Z0-9\-\.\+\=\_]/;
|
||||
our $SAFE_CHAR_WITH_WHITESPACE_CLASS_RE = qr/[ a-zA-Z0-9\-\.\+\=\_]/;
|
||||
|
||||
our $OVA_CONTENT_RE_1 = qr/${SAFE_CHAR_CLASS_RE}+\.(qcow2|raw|vmdk)/;
|
||||
our $OVA_CONTENT_RE_1 = qr/${SAFE_CHAR_WITH_WHITESPACE_CLASS_RE}+\.(qcow2|raw|vmdk)/;
|
||||
|
||||
# FIXME remove with PVE 9.0, add versioned breaks for pve-manager
|
||||
our $vztmpl_extension_re = $VZTMPL_EXT_RE_1;
|
||||
|
||||
Reference in New Issue
Block a user