Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---
 PVE/API2/Storage/FileRestore.pm | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/PVE/API2/Storage/FileRestore.pm b/PVE/API2/Storage/FileRestore.pm
index a4bad44..ccc56e5 100644
--- a/PVE/API2/Storage/FileRestore.pm
+++ b/PVE/API2/Storage/FileRestore.pm
@@ -111,14 +111,12 @@ __PACKAGE__->register_method ({
        my $cfg = PVE::Storage::config();
        my $scfg = PVE::Storage::storage_config($cfg, $storeid);
 
-       PVE::Storage::check_volume_access($rpcenv, $user, $cfg, undef, $volid);
+       PVE::Storage::check_volume_access($rpcenv, $user, $cfg, undef, $volid, 
'backup');
 
        raise_param_exc({'storage' => "Only PBS storages supported for 
file-restore."})
            if $scfg->{type} ne 'pbs';
 
-       my ($vtype, $snap) = PVE::Storage::parse_volname($cfg, $volid);
-       raise_param_exc({'volume' => 'Not a backup archive.'})
-           if $vtype ne 'backup';
+       my (undef, $snap) = PVE::Storage::parse_volname($cfg, $volid);
 
        my $client = PVE::PBSClient->new($scfg, $storeid);
        my $ret = $client->file_restore_list($snap, $path, $base64);
@@ -177,14 +175,12 @@ __PACKAGE__->register_method ({
        my $cfg = PVE::Storage::config();
        my $scfg = PVE::Storage::storage_config($cfg, $storeid);
 
-       PVE::Storage::check_volume_access($rpcenv, $user, $cfg, undef, $volid);
+       PVE::Storage::check_volume_access($rpcenv, $user, $cfg, undef, $volid, 
'backup');
 
        raise_param_exc({'storage' => "Only PBS storages supported for 
file-restore."})
            if $scfg->{type} ne 'pbs';
 
-       my ($vtype, $snap) = PVE::Storage::parse_volname($cfg, $volid);
-       raise_param_exc({'volume' => 'Not a backup archive.'})
-           if $vtype ne 'backup';
+       my (undef, $snap) = PVE::Storage::parse_volname($cfg, $volid);
 
        my $client = PVE::PBSClient->new($scfg, $storeid);
        my $fifo = $client->file_restore_extract_prepare();
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to