From 26f14f6b07295150fe131c561868d22ff0fd59e9 Mon Sep 17 00:00:00 2001 From: Stefan Reiter Date: Mon, 17 Jun 2019 11:05:32 +0200 Subject: [PATCH] fix #2226: allow broken symlinks to be deleted via API Symlinks with a non-existing target fail Perls '-f' test and were thus not deleteable via the API (failing with '$path does not exist'). Signed-off-by: Stefan Reiter --- PVE/Storage/Plugin.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 255c643..e20acb3 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -689,8 +689,8 @@ sub free_image { if (defined($format) && ($format eq 'subvol')) { File::Path::remove_tree($path); } else { - - if (! -f $path) { + + if (! (-f $path || -l $path)) { warn "disk image '$path' does not exists\n"; return undef; }