From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 8A0FE1FF15E for ; Wed, 21 Jan 2026 11:34:38 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DA1302208C; Wed, 21 Jan 2026 11:34:52 +0100 (CET) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Date: Wed, 21 Jan 2026 11:32:31 +0100 Message-ID: <20260121103407.187187-4-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.082 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 proxmox] fix #7077: Improve error message for SDN IDs shorter than 2 characters 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 regex in verify_sdn_id implicitly requires at least 2 characters, but shorter IDs only failed with "contains illegal characters". Now return a clearer error message for this case. Signed-off-by: Arthur Bied-Charreton --- pve-api-types/src/types/verifiers.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pve-api-types/src/types/verifiers.rs b/pve-api-types/src/types/verifiers.rs index c45063b5..aa6c7f40 100644 --- a/pve-api-types/src/types/verifiers.rs +++ b/pve-api-types/src/types/verifiers.rs @@ -269,6 +269,10 @@ pub fn verify_sdn_id(s: &str) -> Result<(), Error> { bail!("SDN ID cannot be longer than 8 characters") } + if s.len() < 2 { + bail!("SDN ID cannot be shorter than 2 characters"); + } + if !SDN_ID.is_match(s) { bail!("SDN ID contains illegal characters"); } -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel