From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C878B1FF15E for ; Wed, 21 Jan 2026 11:34:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AA3F422040; Wed, 21 Jan 2026 11:34:25 +0100 (CET) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Date: Wed, 21 Jan 2026 11:32:33 +0100 Message-ID: <20260121103407.187187-6-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260121103407.187187-1-a.bied-charreton@proxmox.com> References: <20260121103407.187187-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.071 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH pve-network 2/2] fix #7077: Respect noerr flag in SDN ID validation X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The length checks in parse_sdn*_id functions would ignore the '$noerr' parameter and always die on too-long IDs. Also fixes grammar in error messages ("more length" -> "longer"). Signed-off-by: Arthur Bied-Charreton --- src/PVE/Network/SDN/Controllers/Plugin.pm | 7 ++++++- src/PVE/Network/SDN/VnetPlugin.pm | 7 ++++++- src/PVE/Network/SDN/Zones/Plugin.pm | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/Plugin.pm b/src/PVE/Network/SDN/Controllers/Plugin.pm index f117f28..52e385c 100644 --- a/src/PVE/Network/SDN/Controllers/Plugin.pm +++ b/src/PVE/Network/SDN/Controllers/Plugin.pm @@ -39,7 +39,12 @@ sub parse_sdn_controller_id { return undef if $noerr; die "controller ID '$id' contains illegal characters\n"; } - die "controller ID '$id' can't be more length than 64 characters\n" if length($id) > 64; + + if (length($id) > 64) { + return undef if $noerr; + die "controller ID '$id' can't be longer than 64 characters\n"; + } + return $id; } diff --git a/src/PVE/Network/SDN/VnetPlugin.pm b/src/PVE/Network/SDN/VnetPlugin.pm index a191af1..6c5f997 100644 --- a/src/PVE/Network/SDN/VnetPlugin.pm +++ b/src/PVE/Network/SDN/VnetPlugin.pm @@ -39,7 +39,12 @@ sub parse_sdn_vnet_id { return undef if $noerr; die "vnet ID '$id' contains illegal characters\n"; } - die "vnet ID '$id' can't be more length than 8 characters\n" if length($id) > 8; + + if (length($id) > 8) { + return undef if $noerr; + die "vnet ID '$id' can't be longer than 8 characters\n"; + } + return $id; } diff --git a/src/PVE/Network/SDN/Zones/Plugin.pm b/src/PVE/Network/SDN/Zones/Plugin.pm index 14e2634..5592a09 100644 --- a/src/PVE/Network/SDN/Zones/Plugin.pm +++ b/src/PVE/Network/SDN/Zones/Plugin.pm @@ -41,7 +41,12 @@ sub parse_sdn_zone_id { return undef if $noerr; die "zone ID '$id' contains illegal characters\n"; } - die "zone ID '$id' can't be more length than 8 characters\n" if length($id) > 8; + + if (length($id) > 8) { + return undef if $noerr; + die "zone ID '$id' can't be longer than 8 characters\n"; + } + return $id; } -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel