From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 160531FF0AF for ; Thu, 22 Oct 2026 09:45:10 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id F064B21612; Thu, 22 Oct 2026 09:45:05 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 22 Oct 2026 09:45:01 +0200 Message-Id: From: "Lukas Wagner" To: =?utf-8?q?Michael_K=C3=B6ppl?= , "Lukas Wagner" , , Subject: Re: [PATCH proxmox v4 17/39] notify: matcher: don't allow empty field/severity matchers X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20261012131413.314088-1-l.wagner@proxmox.com> <20261012131413.314088-18-l.wagner@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792655101265 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.278 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZVTDZROWBE2LBZ7WD4FMOYPNRQNMPTKZ X-Message-ID-Hash: ZVTDZROWBE2LBZ7WD4FMOYPNRQNMPTKZ X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed Oct 21, 2026 at 4:39 PM CEST, Michael K=C3=B6ppl wrote: > On Mon Oct 12, 2026 at 3:13 PM CEST, Lukas Wagner wrote: > > [snip] > >> + >> #[cfg(test)] >> mod test { >> use proxmox_match_expression::Expression; >> diff --git a/proxmox-notify/src/matcher/field.rs b/proxmox-notify/src/ma= tcher/field.rs >> index 4a4b2588..cd23ff9c 100644 >> --- a/proxmox-notify/src/matcher/field.rs >> +++ b/proxmox-notify/src/matcher/field.rs >> @@ -53,6 +53,18 @@ impl MatchDirective for FieldMatcher { >> } >> }) >> } >> + >> + fn validate(&self) -> Result<(), Error> { > > This does allow empty field names, though. More generally, the old field > matcher validated by making sure that the string matches SAFE_ID_REGEX. > So compared to the legacy matchers, this would allow spaces, umlauts, > line breaks, etc. as well. > > So perhaps matching against SAFE_ID_REGEX should be performed here > again? Seems sensible, nice catch!