all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-network 2/3] api: fabrics: check node permissions with the node name in list_all
Date: Fri, 20 Nov 2026 16:22:45 +0100	[thread overview]
Message-ID: <20261120152251.265831-3-g.goller@proxmox.com> (raw)
In-Reply-To: <20261120152251.265831-1-g.goller@proxmox.com>

The node permission check used the hash key from pve-rs as node name.
For GET /cluster/sdn/fabrics/all, this key is the section ID
(<fabric>_<node>), so a user with Sys.Audit only on /nodes/<node> never
saw any fabric node.

New nodes in a pending config only have node_id below 'pending'.

Fixes: 21d2ad3f7b6d ("api: fabrics: add root-level module")
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 src/PVE/API2/Network/SDN/Fabrics.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/API2/Network/SDN/Fabrics.pm b/src/PVE/API2/Network/SDN/Fabrics.pm
index 5644fbee0fff..a669125894a1 100644
--- a/src/PVE/API2/Network/SDN/Fabrics.pm
+++ b/src/PVE/API2/Network/SDN/Fabrics.pm
@@ -156,9 +156,10 @@ __PACKAGE__->register_method({
         }
 
         my @res_nodes;
-        for my $node_id (keys %$nodes) {
-            my $node = $nodes->{$node_id};
+        for my $id (keys %$nodes) {
+            my $node = $nodes->{$id};
             my $fabric_id = $node->{fabric_id} // $node->{pending}->{fabric_id};
+            my $node_id = $node->{node_id} // $node->{pending}->{node_id};
 
             next if !$rpcenv->check_any($authuser, "/sdn/fabrics/$fabric_id", $fabric_privs, 1);
             next if !$rpcenv->check_any($authuser, "/nodes/$node_id", $node_privs, 1);
-- 
2.47.3





  parent reply	other threads:[~2026-11-20 15:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:22 [PATCH network/proxmox-perl-rs 0/3] Fix listing fabric nodes of hosts in multiple fabrics Gabriel Goller
2026-11-20 15:22 ` [PATCH proxmox-perl-rs 1/3] pve-rs: fabrics: list nodes of all fabrics Gabriel Goller
2026-11-20 15:22 ` Gabriel Goller [this message]
2026-11-20 15:22 ` [PATCH pve-network 3/3] api: fabrics: check node permissions with the node name in list_nodes Gabriel Goller

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=20261120152251.265831-3-g.goller@proxmox.com \
    --to=g.goller@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal