]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2857: restore: pass keyfile to pbs-restore
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 20 Jul 2020 08:26:21 +0000 (10:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Jul 2020 09:08:26 +0000 (11:08 +0200)
if configured. otherwise restoring encrypted backups will be quite
hard..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/QemuServer.pm

index 809124c38a02908efd300ca24eae5eaea6c02df6..0a09f3a7e71c33c962e11ea3a1eca539d7a53ba2 100644 (file)
@@ -5937,6 +5937,7 @@ sub restore_proxmox_backup_archive {
     my $datastore = $scfg->{datastore};
     my $username = $scfg->{username} // 'root@pam';
     my $fingerprint = $scfg->{fingerprint};
+    my $keyfile = PVE::Storage::PBSPlugin::pbs_encryption_key_file_name($storecfg, $storeid);
 
     my $repo = "$username\@$server:$datastore";
 
@@ -6054,6 +6055,7 @@ sub restore_proxmox_backup_archive {
                ];
 
            push @$pbs_restore_cmd, '--format', $d->{format} if $d->{format};
+           push @$pbs_restore_cmd, '--keyfile', $keyfile if -e $keyfile;
 
            if (PVE::Storage::volume_has_feature($storecfg, 'sparseinit', $volid)) {
                push @$pbs_restore_cmd, '--skip-zero';