mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-12 11:35:06 +00:00
api: deletion: check also pending values for serial/usb
otherwise a user with only VM.Config.HWType cannot delete a 'pending' usbX: spice or serial: socket option Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
97ef535658
commit
4c1f3929ea
@ -1202,7 +1202,7 @@ my $update_vm_api = sub {
|
||||
PVE::QemuServer::vmconfig_delete_pending_option($conf, $opt, $force);
|
||||
PVE::QemuConfig->write_config($vmid, $conf);
|
||||
} elsif ($opt =~ m/^serial\d+$/) {
|
||||
if ($conf->{$opt} eq 'socket') {
|
||||
if ($conf->{$opt} eq 'socket' || (!$conf->{$opt} && $conf->{pending}->{$opt} eq 'socket')) {
|
||||
$rpcenv->check_vm_perm($authuser, $vmid, undef, ['VM.Config.HWType']);
|
||||
} elsif ($authuser ne 'root@pam') {
|
||||
die "only root can delete '$opt' config for real devices\n";
|
||||
@ -1210,7 +1210,7 @@ my $update_vm_api = sub {
|
||||
PVE::QemuServer::vmconfig_delete_pending_option($conf, $opt, $force);
|
||||
PVE::QemuConfig->write_config($vmid, $conf);
|
||||
} elsif ($opt =~ m/^usb\d+$/) {
|
||||
if ($conf->{$opt} =~ m/spice/) {
|
||||
if ($conf->{$opt} =~ m/spice/ || (!$conf->{$opt} && $conf->{pending}->{$opt} =~ m/spice/)) {
|
||||
$rpcenv->check_vm_perm($authuser, $vmid, undef, ['VM.Config.HWType']);
|
||||
} elsif ($authuser ne 'root@pam') {
|
||||
die "only root can delete '$opt' config for real devices\n";
|
||||
|
Loading…
Reference in New Issue
Block a user