public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH container] fix #8237: delete read restricted options: fix calls to check_vm_perm
Date: Thu, 29 Oct 2026 11:30:51 +0100	[thread overview]
Message-ID: <20261029103113.57887-1-f.ebner@proxmox.com> (raw)

The checks are supposed to pass $noerr=1, but instead passed $any=1.
Therefore, GET requests for '/config' and '/pending' by a user without
'VM.Config.Options' would fail for containers with 'env' set instead
of deleting the key from the result.

Fixes: 9ec1a04 ("api: config: censor env property for users without VM.Config.Options")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/LXC.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 44ae4fa..4afa391 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1639,7 +1639,7 @@ sub delete_read_restricted_options {
     for my ($restricted_key, $required_priv) ($options_with_restricted_read->%*) {
         my $has_no_access = 0;
         if (exists($conf->{$restricted_key})) {
-            if (!$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], 1)) {
+            if (!$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], undef, 1)) {
                 $has_no_access = 1;
                 delete $conf->{$restricted_key};
             }
@@ -1647,7 +1647,7 @@ sub delete_read_restricted_options {
         if (exists($conf->{pending}) && exists($conf->{pending}->{$restricted_key})) {
             if (
                 $has_no_access
-                || !$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], 1)
+                || !$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], undef, 1)
             ) {
                 delete $conf->{pending}->{$restricted_key};
             }
-- 
2.47.3





             reply	other threads:[~2026-10-29 10:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 10:30 Fiona Ebner [this message]
2026-10-29 14:05 ` applied: [PATCH container] fix #8237: delete read restricted options: fix calls to check_vm_perm Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261029103113.57887-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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