public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH container] api: mtunnel: fix handling of privileged containers
@ 2026-09-08 11:59 Fabian Grünbichler
  0 siblings, 0 replies; only message in thread
From: Fabian Grünbichler @ 2026-09-08 11:59 UTC (permalink / raw)
  To: pve-devel

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 <f.gruenbichler@proxmox.com>
---
 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





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-08 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 11:59 [PATCH container] api: mtunnel: fix handling of privileged containers Fabian Grünbichler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal