all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api v2 1/2] fix #4811: rule db: test regex validity on save
Date: Fri, 15 Dec 2023 18:06:04 +0100	[thread overview]
Message-ID: <ZXyHfI7O1PnuX3bz@rosa.proxmox.com> (raw)
In-Reply-To: <ZXyCY2sdhuJznlOv@rosa.proxmox.com>

After testing this a bit more I realized that anchored regexes, don't die
on '^*foo$' (the quite common case of mistaking regex for globs (especially
for filenames) - the warning is printed to the journal - but I can happily
store it (additionally the eval-block in the what/who_match never dies -
and the 'invalid regex:' does not get printed.

maybe we could improve this even further by die'ing upon a warning when
saving the regex? - then the question is if we want to add the eval+warning
code in the who/what_match subs at all (afaict this would only add 'invalid
regex:' to the same log-line.

In any case - thanks for the patch - I never took the time to find out why
some invalid-regexes cause pmg-smtp-filter to exit+respawn, and some others
don't ;)


On Fri, Dec 15, 2023 at 05:44:19PM +0100, Stoiko Ivanov wrote:
> Thanks for the patch, this definitely improves UX!
> 
> one tiny nit in-line (I'll gladly change that upon applying directly, but
> just don't want to miss anything):
>..snip.. 




  reply	other threads:[~2023-12-15 17:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30  8:27 Dominik Csapak
2023-06-30  8:27 ` [pmg-devel] [PATCH pmg-api v2 2/2] statistics: fix update virusinfo Dominik Csapak
2023-06-30 13:41   ` [pmg-devel] applied: " Stoiko Ivanov
2023-12-15 16:44 ` [pmg-devel] [PATCH pmg-api v2 1/2] fix #4811: rule db: test regex validity on save Stoiko Ivanov
2023-12-15 17:06   ` Stoiko Ivanov [this message]
2023-12-18 13:34     ` Dominik Csapak
2023-12-18 13:33   ` Dominik Csapak

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=ZXyHfI7O1PnuX3bz@rosa.proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pmg-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal