[pve-devel] [PATCH storage] fix #3363: avoid undef-warning for PBS crypt-mode

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Mar 24 13:24:41 CET 2021


it is optional after all, and missing (/None) for files stored in the
snapshot dir but not referenced in the manifest for whatever reason.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/Storage/PBSPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm
index 6c6816e..df3aaab 100644
--- a/PVE/Storage/PBSPlugin.pm
+++ b/PVE/Storage/PBSPlugin.pm
@@ -527,7 +527,7 @@ my sub snapshot_files_encrypted {
 	my $crypt = $file->{'crypt-mode'};
 
 	$all = 0 if !$crypt || $crypt ne 'encrypt';
-	$any ||= $crypt eq 'encrypt';
+	$any ||= defined($crypt) && $crypt eq 'encrypt';
     }
     return $any && $all;
 }
-- 
2.20.1






More information about the pve-devel mailing list