From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B681DFB28 for ; Mon, 24 Jul 2023 13:35:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 916F4D933 for ; Mon, 24 Jul 2023 13:34:32 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 24 Jul 2023 13:34:31 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E082343AED for ; Mon, 24 Jul 2023 13:34:30 +0200 (CEST) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Mon, 24 Jul 2023 13:33:48 +0200 Message-Id: <20230724113348.120113-1-f.weber@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.260 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH qemu-server] cloudinit: allow non-root users to set ciupgrade option X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2023 11:35:02 -0000 The new ciupgrade option was missing in $cloudinitoptions in PVE::API2::Qemu, so $check_vm_modify_config_perm defaulted to requiring root@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 --- Notes: Not sure if this is the proper fix. Instead of maintaining two lists of cloudinit options, we could generate $cloudinitoptions from $confdesc_cloudinit? PVE/API2/Qemu.pm | 1 + PVE/QemuServer.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 5930713..d57b8e8 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -562,6 +562,7 @@ my $cloudinitoptions = { cipassword => 1, citype => 1, ciuser => 1, + ciupgrade => 1, nameserver => 1, searchdomain => 1, sshkeys => 1, diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 430661a..e41d017 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -760,6 +760,7 @@ my $cicustom_fmt = { }; PVE::JSONSchema::register_format('pve-qm-cicustom', $cicustom_fmt); +# any new option might need to be added to $cloudinitoptions in PVE::API2::Qemu my $confdesc_cloudinit = { citype => { optional => 1, -- 2.39.2