From 24e632818b20d6b185f66e2aa77b5bb944805199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 16 Aug 2022 11:45:41 +0200 Subject: [PATCH] pbs: detect mismatch of encryption settings and key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if the key file doesn't exist (anymore), but the storage.cfg references one, die when starting a backup that should use encryption instead of falling back to plain-text operations. Signed-off-by: Fabian Grünbichler --- PVE/VZDump/QemuServer.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index 74295082..0738051d 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -559,6 +559,9 @@ sub archive_pbs { $params->{"master-keyfile"} = $master_keyfile; } } else { + my $encryption_fp = $scfg->{'encryption-key'}; + die "encryption configured ('$encryption_fp') but no encryption key file found!\n" + if $encryption_fp; $self->loginfo("WARNING: backup target is configured with master key, but this backup is not encrypted - master key settings will be ignored!") if defined($master_keyfile) && -e $master_keyfile; $params->{encrypt} = JSON::false;