untrusted image checks: also handle multi-part vmdk files
neither vmdk images with multiple children, nor ones with multiple extents (that might in turn be backed by multiple files) are allowed when an image is untrusted. Reported-by: Friedrich Weber <f.weber@proxmox.com> Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
a3db720967
commit
3633dee46d
@ -1012,6 +1012,11 @@ sub file_size_info {
|
||||
if (my $format_specific = $info->{'format-specific'}) {
|
||||
if ($format_specific->{type} eq 'qcow2' && $format_specific->{data}->{"data-file"}) {
|
||||
die "$filename: 'data-file' references are not allowed!\n";
|
||||
} elsif ($format_specific->{type} eq 'vmdk') {
|
||||
my $extents = $format_specific->{data}->{extents};
|
||||
my $children = $info->{children};
|
||||
die "$filename: multiple children or extents are not allowed!\n"
|
||||
if scalar($children->@*) > 1 || scalar($extents->@*) > 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user