]> git.proxmox.com Git - qemu-server.git/commitdiff
fix: api: fix permission check for cloudinit drive update
authorFriedrich Weber <f.weber@proxmox.com>
Mon, 13 Mar 2023 12:56:25 +0000 (13:56 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 25 Jul 2023 15:23:17 +0000 (17:23 +0200)
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 <f.weber@proxmox.com>
PVE/API2/Qemu.pm

index 030b3bade041ce3af0576ba3a671c16bded904f5..1cff80b6b464c46608e83cfa9d4b0c157dbe5911 100644 (file)
@@ -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,