From da2cf5806b478cc617c8025f493dceaf7b2d3f0e Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Fri, 6 Dec 2024 17:25:38 +0100 Subject: [PATCH] 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 --- PVE/API2/Qemu.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index fb192760..bf1e1bb0 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -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') {