[pve-devel] [PATCH installer 1/2] common: pinning: require first character to be lower-case ascii

Stoiko Ivanov s.ivanov at proxmox.com
Wed Nov 26 19:15:55 CET 2025


On Tue, 25 Nov 2025 07:54:52 +0100
Thomas Lamprecht <t.lamprecht at proxmox.com> wrote:

> Am 18.11.25 um 16:15 schrieb Stoiko Ivanov:
> > the validation regex in pve-common is:
> > `/^[a-z][a-z0-9_]{1,20}([:\.]\d+)?$/` [0]  
> 
> Recently re-checked this patch, as when adding some tests for this, the
> behavior of allowing uppercase characters for all but the first one 
> seemed strange given above regex.
> 
> But this isn't the real regex though, as that would require all lowercase,
> not just the first character. The real regex as linked by [0] has a
> case-insensitive flag applied, so the case limitations of your patch suggest
> are overly strict compared to what pve-common accepts.
> It can be fine to be a bit more restrictive here, but lets not justificate
> doing so with a wrongly quoted validation regex.
> 
Thanks for catching this! as my previous attempts at getting this in sync
with what pve-common does always missed something (and/or followed my
gut-feeling more than what the code in pve-common actually does) - I
copied the validation from pve-common:
https://lore.proxmox.com/pve-devel/20251126180819.817240-1-s.ivanov@proxmox.com/T/#t





More information about the pve-devel mailing list