mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-29 20:58:54 +00:00
fix #2175: PVE/API2/Qemu: update_vm_api: check old drive for permissions too
otherwise a user with only VM.Config.CDROM can detach a disk from a VM by updating it to a cdrom drive Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
bb660bc3ce
commit
2c44ec4974
@ -1346,6 +1346,12 @@ my $update_vm_api = sub {
|
|||||||
my $arch = PVE::QemuServer::get_vm_arch($conf);
|
my $arch = PVE::QemuServer::get_vm_arch($conf);
|
||||||
|
|
||||||
if (PVE::QemuServer::is_valid_drivename($opt)) {
|
if (PVE::QemuServer::is_valid_drivename($opt)) {
|
||||||
|
# old drive
|
||||||
|
if ($conf->{$opt}) {
|
||||||
|
$check_drive_perms->($opt, $conf->{$opt});
|
||||||
|
}
|
||||||
|
|
||||||
|
# new drive
|
||||||
$check_drive_perms->($opt, $param->{$opt});
|
$check_drive_perms->($opt, $param->{$opt});
|
||||||
PVE::QemuServer::vmconfig_register_unused_drive($storecfg, $vmid, $conf, PVE::QemuServer::parse_drive($opt, $conf->{pending}->{$opt}))
|
PVE::QemuServer::vmconfig_register_unused_drive($storecfg, $vmid, $conf, PVE::QemuServer::parse_drive($opt, $conf->{pending}->{$opt}))
|
||||||
if defined($conf->{pending}->{$opt});
|
if defined($conf->{pending}->{$opt});
|
||||||
|
Loading…
Reference in New Issue
Block a user