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 AB1E91FF0AF for ; Fri, 20 Nov 2026 16:23:20 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E575921819; Fri, 20 Nov 2026 16:23:01 +0100 (CET) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network 3/3] api: fabrics: check node permissions with the node name in list_nodes Date: Fri, 20 Nov 2026 16:22:46 +0100 Message-ID: <20261120152251.265831-4-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: 1795188176409 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 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: M5T55K242FACDX2BE53UPBVCU4OOK4CR X-Message-ID-Hash: M5T55K242FACDX2BE53UPBVCU4OOK4CR 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: With the proxmox-perl-rs commit "pve-rs: fabrics: list nodes of all fabrics", list_nodes() keys the nodes by section ID (_) instead of the node name. Like for GET /cluster/sdn/fabrics/all, the key can then no longer be used for the node permission check. New nodes in a pending config only have node_id and fabric_id below 'pending'. Signed-off-by: Gabriel Goller --- src/PVE/API2/Network/SDN/Fabrics/Node.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/PVE/API2/Network/SDN/Fabrics/Node.pm b/src/PVE/API2/Network/SDN/Fabrics/Node.pm index 851c8b1230fc..1141c6030b9e 100644 --- a/src/PVE/API2/Network/SDN/Fabrics/Node.pm +++ b/src/PVE/API2/Network/SDN/Fabrics/Node.pm @@ -93,9 +93,10 @@ __PACKAGE__->register_method({ my @res; - for my $node_id (keys %$nodes) { - my $node = $nodes->{$node_id}; - my $fabric_id = $node->{fabric_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