[pve-devel] [PATCH qemu-server] fix unnecessary root check for unused disks

Dominik Csapak d.csapak at proxmox.com
Fri Jun 10 09:26:14 CEST 2016


we needed root at pam rights to remove an unused disk
from a vm (instead of the correct Storage rights)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
the datastore.allocate permission is checked elsewhere
 PVE/API2/Qemu.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index aadfde5..c0a72c0 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -243,6 +243,7 @@ my $check_vm_modify_config_perm = sub {
 	# disk checks need to be done somewhere else
 	next if PVE::QemuServer::is_valid_drivename($opt);
 	next if $opt eq 'cdrom';
+	next if $opt =~ m/^unused\d+$/;
 
 	if ($cpuoptions->{$opt} || $opt =~ m/^numa\d+$/) {
 	    $rpcenv->check_vm_perm($authuser, $vmid, $pool, ['VM.Config.CPU']);
-- 
2.1.4




More information about the pve-devel mailing list