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 BCCE51FF15E for ; Wed, 21 Jan 2026 11:34:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BDA3E21FDA; Wed, 21 Jan 2026 11:34:51 +0100 (CET) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Date: Wed, 21 Jan 2026 11:32:29 +0100 Message-ID: <20260121103407.187187-2-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.097 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-common] fix #7077: Improve error message for 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 JSONSchema::parse_id requires at least 2 characters, but shorter IDs only failed with "contains illegal characters". Add explicit length check to return a clearer error message in this case. Signed-off-by: Arthur Bied-Charreton --- src/PVE/JSONSchema.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 0c9bb82..17e7126 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -289,6 +289,11 @@ sub parse_acme_plugin_id { sub parse_id { my ($id, $type, $noerr) = @_; + if (length($id) < 2) { + return undef if $noerr; + die "$type ID '$id' cannot be shorter than 2 characters\n"; + } + if ($id !~ m/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i) { return undef if $noerr; die "$type ID '$id' contains illegal characters\n"; -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel