Am 15/11/2023 um 16:12 schrieb Stefan Sterz:
> just to through this out there, my last attempt at validating this [1]
> looked something like this:
> 
> ```
> my $escaped  = qr!\\(?:[ "#+,;<=>\\]|[0-9a-fA-F]{2})!;
> my $start    = qr!(?:${escaped}|[^"+,;<>\\\0 #])!;
> my $middle   = qr!(?:${escaped}|[^"+,;<>\\\0])!;
> my $end      = qr!(?:${escaped}|[^"+,;<>\\\0 ])!;
> my $attr_val = qr!("[^"]+"|${start}(?:${middle}*${end})?)!;
> ```
> 
> since things can also be escaped or in quotes, which makes them valid
> again. could probably be improved here, though.
> 
> [1]: https://lists.proxmox.com/pipermail/pve-devel/2023-May/056840.html

Thanks for the pointer, memories are comming back now..

It seems like `$attr =~ /^(.*)$/ && return $1` (if even needed to avoid
tainting) seems the more practical solution here...



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to