api: create disks: import from absolute path: adapt to new parameter order for file_size_info()

Keep format auto-detection for backwards compatibility. Only root is
allowed to use such images as source images and the untrusted checks
will be done here.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2024-12-06 17:25:38 +01:00 committed by Fabian Grünbichler
parent ccc3bae30a
commit da2cf5806b

View File

@ -499,7 +499,8 @@ my sub create_disks : prototype($$$$$$$$$$$) {
} else {
$source = PVE::Storage::abs_filesystem_path($storecfg, $source, 1);
# check potentially untrusted image file!
($size, my $source_format) = PVE::Storage::file_size_info($source, undef, 1);
($size, my $source_format) =
PVE::Storage::file_size_info($source, undef, 'auto-detect', 1);
die "could not get file size of $source\n" if !$size;
if ($live_import && $ds ne 'efidisk0') {