backup: add missing user check in update_job

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
This commit is contained in:
Oguz Bektas 2020-07-07 14:55:39 +02:00 committed by Thomas Lamprecht
parent ecddd2e231
commit d5b9f2e1cb

View File

@ -265,6 +265,12 @@ __PACKAGE__->register_method({
my $rpcenv = PVE::RPCEnvironment::get();
my $user = $rpcenv->get_user();
foreach my $key (qw(tmpdir dumpdir script)) {
raise_param_exc({ $key => "Only root may set this option."})
if defined($param->{$key}) && ($user ne 'root@pam');
}
if (my $pool = $param->{pool}) {
$rpcenv->check_pool_exist($pool);
$rpcenv->check($user, "/pool/$pool", ['VM.Backup']);