[pve-devel] applied: [PATCH qemu-server] cloudinit: allow non-root users to set ciupgrade option

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 25 11:54:34 CEST 2023


On 24/07/2023 13:33, Friedrich Weber wrote:
> The new ciupgrade option was missing in $cloudinitoptions in
> PVE::API2::Qemu, so $check_vm_modify_config_perm defaulted to
> requiring root at pam for modifying the option. To fix this, add
> ciupgrade to $cloudinitoptions. This also fixes an issue where
> ciupgrade was missing in the output of `qm cloudinit pending`,
> as it also relies on $cloudinitoptions.
> 
> This issue was originally reported in the forum [0].
> 
> Also add a comment to avoid similar issues when adding new options in
> the future.
> 
> [0]: https://forum.proxmox.com/threads/131043/
> 
> Signed-off-by: Friedrich Weber <f.weber at proxmox.com>
> ---
> 
> Notes:
>     Not sure if this is the proper fix. Instead of maintaining two lists
>     of cloudinit options, we could generate $cloudinitoptions from
>     $confdesc_cloudinit?

It's not making anything worse and is a good stop-gap, but yeah those
list is a bit too distant from the schema definition.

How about a get_vm_user_cloudinit_options helper located directly
below the format definition, filtering out those keys that do not
make sense, or are off limits, and use that?

Maybe with some wider clean-up for the others? But this is also a
bit thankless work and would definitively need some test harness
to ensure no regression gets in.

> 
>  PVE/API2/Qemu.pm  | 1 +
>  PVE/QemuServer.pm | 1 +
>  2 files changed, 2 insertions(+)
> 
>

applied, thanks!





More information about the pve-devel mailing list