From dafabbd01fa2612b7d28a7bc5c6bf876259309f8 Mon Sep 17 00:00:00 2001 From: Friedrich Weber Date: Mon, 13 Mar 2023 13:56:25 +0100 Subject: [PATCH] fix: api: fix permission check for cloudinit drive update Trying to regenerate a cloudinit drive as a non-root user via the API currently throws a Perl error, as reported in the forum [1]. This is due to a type mismatch in the permission check, where a string is passed but an array is expected. [1] https://forum.proxmox.com/threads/regenerate-cloudinit-by-put-api-return-500.124099/ Signed-off-by: Friedrich Weber --- PVE/API2/Qemu.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 030b3ba..1cff80b 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1482,7 +1482,7 @@ __PACKAGE__->register_method({ proxyto => 'node', description => "Regenerate and change cloudinit config drive.", permissions => { - check => ['perm', '/vms/{vmid}', 'VM.Config.Cloudinit'], + check => ['perm', '/vms/{vmid}', ['VM.Config.Cloudinit']], }, parameters => { additionalProperties => 0, -- 2.39.2