]> git.proxmox.com Git - pve-storage.git/commitdiff
pbs: check if encryption key could be deleted
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 24 Jul 2020 17:06:01 +0000 (19:06 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 24 Jul 2020 17:06:09 +0000 (19:06 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/PBSPlugin.pm

index fa966d989081daf0b2695cd4aae4dca1d8fbc821..1edacccf33fcd676171c5f3a03bdd457a91d30b9 100644 (file)
@@ -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'};
 }