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 236041FF178 for ; Mon, 1 Dec 2025 12:46:39 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 56B981A603; Mon, 1 Dec 2025 12:47:01 +0100 (CET) Date: Mon, 1 Dec 2025 12:46:26 +0100 From: Stoiko Ivanov To: Fiona Ebner Message-ID: <20251201124626.2ddecb15@rosa.proxmox.com> In-Reply-To: <623c44ed-bbad-4c3a-b5c1-66f5a47f8d5c@proxmox.com> References: <20251126180819.817240-1-s.ivanov@proxmox.com> <20251126180819.817240-3-s.ivanov@proxmox.com> <623c44ed-bbad-4c3a-b5c1-66f5a47f8d5c@proxmox.com> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1764589544056 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.072 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH installer 2/2] common: pinning: use pve-iface regular expression for 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 Cc: 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" Nice catch - Thanks! On Mon, 1 Dec 2025 11:53:53 +0100 Fiona Ebner wrote: > Am 26.11.25 um 7:08 PM schrieb Stoiko Ivanov: > > + static RE: OnceLock = OnceLock::new(); > > + let re = RE.get_or_init(|| { > > + RegexBuilder::new(r"^[a-z][a-z0-9_]{1,20}([:\.]\d+)?$") > > Should the later part with a colon really be allowed? On the new test > ISO, a name like 'nicat:3' will be accepted, but won't actually work > later when booting: given the back and forth [0] of trying to get this in sync with pve-common's JSONSchema.pm I did use the literal regex from there on purpose... > "Interface name is not valid or too long, ignoring assignment: nicat:3" ...not considering that these are interface-names for the kernel, while `prefix:\d` and `prefix\.\d` are syntax for /etc/network/interfaces (the former for aliaseses (having a second ip/network on one interface), the latter for VLAN tags). It would probably make sense to add a separate validation for kernel iface names somewhere centrally and use/reference that (everywhere), but I'd like to avoid to deviate here from the one thing we (afaict?) always reference when we deal with "NIC names". Apart from disallowing the `([:\.]\d+)?` trailer - this would also restrict the length to 15 characters fwict. In practical terms I don't think keeping it as is has a large potential for regression (not expecting many users to touch the advanced mappings, and even if they add :\d there they'd notice after rebooting the first time). > > I guess the dot can make sense if there are multiple NICs, so you could > have e.g. 'nic0' and 'nic0.3'? see above - afaict in Debian/ifupdown terms these are used for vlan-interfaces (and might lead to unexpected results if used for plain nic-names (did not test this though)) [0] e.g. https://lore.proxmox.com/all/20251113135023.1038305-1-c.heiss@proxmox.com/ https://lore.proxmox.com/all/20251118151532.592423-1-s.ivanov@proxmox.com/ https://lore.proxmox.com/all/20251126180819.817240-1-s.ivanov@proxmox.com/ _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel