From 4ef17e1fe0b6c5a9ca62a0a436461e0911e73b72 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 24 Jul 2020 19:06:01 +0200 Subject: [PATCH] pbs: check if encryption key could be deleted Signed-off-by: Thomas Lamprecht --- PVE/Storage/PBSPlugin.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm index fa966d9..1edaccc 100644 --- a/PVE/Storage/PBSPlugin.pm +++ b/PVE/Storage/PBSPlugin.pm @@ -113,7 +113,10 @@ sub pbs_delete_encryption_key { my $pwfile = pbs_encryption_key_file_name($scfg, $storeid); - unlink $pwfile; + if (!unlink $pwfile) { + return if $! == ENOENT; + die "failed to delete encryption key! $!\n"; + } delete $scfg->{'encryption-key'}; } -- 2.39.5