]> git.proxmox.com Git - qemu-server.git/commit - PVE/API2/Qemu.pm
fix #4321: properly check cloud-init drive permissions
authorLeo Nunner <l.nunner@proxmox.com>
Wed, 16 Nov 2022 17:34:29 +0000 (18:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 17 Nov 2022 07:10:28 +0000 (08:10 +0100)
commitf5a88e98703cfb5bd6a34bd6579a3b18ca30444c
tree03d68fbbaeeb5e77dae2cbb80280d8d7719384ae
parent0a1c4503e5c9ab2b828ee3df66f4f17b239d8951
fix #4321: properly check cloud-init drive permissions

The process for editing Cloud-init drives checked for inconsistent
permissions: for adding, the VM.Config.Disk permission was needed, while
the VM.Config.CDROM permission was needed to remove a drive. The regex
in drive_is_cloudinit needed to be adapted since the drive names have
different formats before/after they are actually generated.

Due to the regex letting names fall through before, Cloud-init drives
were being checked as disks, even though they are actually treated as
CDROM drives. Due to this, it makes more sense to check for
VM.Config.CDROM instead, while also requiring VM.Config.Cloudinit, since
generating a Cloud-init drive already generates default values that are
passed to the VM.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuServer/Drive.pm