From 7a516cbfd18b38702e5a8125ba4022061f0ffb9b Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Tue, 15 Nov 2022 13:33:05 +0100 Subject: [PATCH] api: vzdump: also check for default storage permission Acked-by: Thomas Lamprecht Reviewed-by: Thomas Lamprecht Signed-off-by: Fiona Ebner --- PVE/API2/VZDump.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/API2/VZDump.pm b/PVE/API2/VZDump.pm index 82b28db5..024d332b 100644 --- a/PVE/API2/VZDump.pm +++ b/PVE/API2/VZDump.pm @@ -96,8 +96,9 @@ __PACKAGE__->register_method ({ die "you can only backup a single VM with option --stdout\n" if $param->{stdout} && scalar(@{$local_vmids}) != 1; - $rpcenv->check($user, "/storage/$param->{storage}", [ 'Datastore.AllocateSpace' ]) - if $param->{storage}; + # If the root-only dumpdir is used rather than a storage, the check will succeed anyways. + my $storeid = $param->{storage} || 'local'; + $rpcenv->check($user, "/storage/$storeid", [ 'Datastore.AllocateSpace' ]); my $worker = sub { my $upid = shift;