[pve-devel] [PATCH storage] archive_info: relax custom name handling

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jul 8 12:05:02 CEST 2020


we already differentiate between standard and non-standard names anyway
and don't detect and return the VMID in the latter case anyway. drop it
from the RE as well to allow names like 'vzdump-qemu-template.vma.lzo'
without the need for a fake VMID.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
we previously handled those names just fine, and this is affecting
existing usecases:

https://lists.proxmox.com/pipermail/pve-user/2020-July/171802.html

 PVE/Storage.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index ffa1484..edf9a2e 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -1393,7 +1393,7 @@ sub archive_info {
     my $info;
 
     my $volid = basename($archive);
-    if ($volid =~ /^(vzdump-(lxc|openvz|qemu)-\d+-.+\.(tgz$|tar|vma)(?:\.(${\PVE::Storage::Plugin::COMPRESSOR_RE}))?)$/) {
+    if ($volid =~ /^(vzdump-(lxc|openvz|qemu)-.+\.(tgz$|tar|vma)(?:\.(${\PVE::Storage::Plugin::COMPRESSOR_RE}))?)$/) {
 	my $filename = "$1"; # untaint
 	my ($type, $format, $comp) = ($2, $3, $4);
 	my $format_re = defined($comp) ? "$format.$comp" : "$format";
-- 
2.20.1






More information about the pve-devel mailing list