[pve-devel] [PATCH qemu-server] api/resume: make nocheck root-only

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Apr 27 09:19:13 CEST 2020


this is only used for migration via 'qm mtunnel', regular users should
never need to resume a VM that does not logically belong to the node it
is running on

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/API2/Qemu.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index b3683ae..9658a36 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2593,6 +2593,8 @@ __PACKAGE__->register_method({
 	    if $skiplock && $authuser ne 'root at pam';
 
 	my $nocheck = extract_param($param, 'nocheck');
+	raise_param_exc({ nocheck => "Only root may use this option." })
+	    if $nocheck && $authuser ne 'root at pam';
 
 	my $to_disk_suspended;
 	eval {
-- 
2.20.1





More information about the pve-devel mailing list