public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Stefan Sterz <s.sterz@proxmox.com>,
	Markus Frank <m.frank@proxmox.com>
Subject: Re: [pve-devel] [PATCH common] fix #5034 ldap attribute regex
Date: Wed, 15 Nov 2023 16:48:47 +0100	[thread overview]
Message-ID: <0ea508f6-38bd-44c3-be76-9612ad4bc22c@proxmox.com> (raw)
In-Reply-To: <b0ab477a-a7f4-4b4d-bd59-a7a89ca17e85@proxmox.com>

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...





  reply	other threads:[~2023-11-15 15:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 12:23 Markus Frank
2023-11-15 13:28 ` Stefan Sterz
2023-11-15 14:49   ` Thomas Lamprecht
2023-11-15 15:12     ` Stefan Sterz
2023-11-15 15:48       ` Thomas Lamprecht [this message]
2023-11-15 15:02   ` Stefan Sterz
2023-11-15 13:30 ` Thomas Lamprecht
2023-11-21 12:55   ` Christoph Heiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ea508f6-38bd-44c3-be76-9612ad4bc22c@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=m.frank@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.sterz@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal