From 59a54b3d5ff5dc205616fff2774d4e276b1f1f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 31 Jul 2025 13:15:17 +0200 Subject: [PATCH] fix #6584: plugin: list_images: only include parseable filenames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit by only including filenames that are also valid when actually parsing them, things like snapshot files or files not following our naming scheme are no longer candidates for rescanning or included in other output. Co-authored-by: Shannon Sterz Signed-off-by: Fabian Grünbichler Tested-by: Shannon Sterz Link: https://lore.proxmox.com/20250731111519.931104-3-f.gruenbichler@proxmox.com --- src/PVE/Storage/Plugin.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm index c08f5a5..affe7b0 100644 --- a/src/PVE/Storage/Plugin.pm +++ b/src/PVE/Storage/Plugin.pm @@ -1555,6 +1555,10 @@ sub list_images { next if !$vollist && defined($vmid) && ($owner ne $vmid); + # skip files that are snapshots or have invalid names + my ($parsed_name) = eval { parse_name_dir(basename($fn)) }; + next if !defined($parsed_name); + my ($size, undef, $used, $parent, $ctime) = eval { file_size_info($fn, undef, $format); }; if (my $err = $@) { die $err if $err !~ m/Image is not in \S+ format$/;