]> git.proxmox.com Git - qemu-server.git/commitdiff
pbs: detect mismatch of encryption settings and key
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 16 Aug 2022 09:45:41 +0000 (11:45 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 16 Aug 2022 11:52:50 +0000 (13:52 +0200)
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 <f.gruenbichler@proxmox.com>
PVE/VZDump/QemuServer.pm

index 7429508241e716cc8ffd092230b963e094192f34..0738051dbb22bdd102d7df42ca65d9b2c1ffb424 100644 (file)
@@ -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;