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 1E9E41FF0AF for ; Fri, 20 Nov 2026 16:23:07 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D4F552179F; Fri, 20 Nov 2026 16:23:00 +0100 (CET) From: Gabriel Goller 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 Message-ID: <20261120152251.265831-3-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261120152251.265831-1-g.goller@proxmox.com> References: <20261120152251.265831-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795188176296 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.069 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) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes 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: RDHREFQG5SQFLVBOOMGNX2KGROTDZLLP X-Message-ID-Hash: RDHREFQG5SQFLVBOOMGNX2KGROTDZLLP X-MailFrom: g.goller@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 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 (_), so a user with Sys.Audit only on /nodes/ 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 --- 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