From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 844231FF0B2 for ; Tue, 08 Sep 2026 14:00:45 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 825792156A; Tue, 08 Sep 2026 14:00:41 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pve-devel@lists.proxmox.com Subject: [PATCH container] api: mtunnel: fix handling of privileged containers Date: Tue, 8 Sep 2026 13:59:29 +0200 Message-ID: <20260908120035.416049-1-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788868828957 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.844 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 5FIIJRBZKT6E3DI6A3RQXOX4IHNIIQVV X-Message-ID-Hash: 5FIIJRBZKT6E3DI6A3RQXOX4IHNIIQVV X-MailFrom: f.gruenbichler@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: the unprivileged flag is only set in the config for unprivileged containers, privileged containers normally simply do not have a value set. passing an undef value is persisted in the config as unprivileged: which triggers a warning when parsing the config later on. by only setting the config key in the unprivileged case, the behaviour is identical to container creation. Reported in the community forum: https://forum.proxmox.com/threads/186251/ Signed-off-by: Fabian Grünbichler --- src/PVE/API2/LXC.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 42d51a0..5f94d5a 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -3269,10 +3269,13 @@ __PACKAGE__->register_method({ eval { my $conf = { - unprivileged => $unprivileged, arch => $arch, }; - $rpcenv->check($authuser, '/', ['Sys.Modify']) if !$unprivileged; + if ($unprivileged) { + $conf->{unprivileged} = 1; + } else { + $rpcenv->check($authuser, '/', ['Sys.Modify']); + } PVE::LXC::check_ct_modify_config_perm( $rpcenv, $authuser, -- 2.47.3