all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-mail-forward] pbs user config: allow parsing unknown sections
Date: Fri, 25 Nov 2022 16:15:36 +0100	[thread overview]
Message-ID: <20221125151536.190947-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20221125151536.190947-1-f.ebner@proxmox.com>

Previously, configs with entries for tokens could not be parsed
successfully, so extracting the mail for the root user failed.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

Dependency bump for proxmox-section-config needed.

 src/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index d53a1b4..f3d4193 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -46,7 +46,7 @@ fn normalize_for_return(s: Option<&str>) -> Option<String> {
 
 /// Extract the root user's email address from the PBS user config.
 fn get_pbs_mail_to(content: &str) -> Option<String> {
-    let mut config = SectionConfig::new(&DUMMY_ID_SCHEMA);
+    let mut config = SectionConfig::new(&DUMMY_ID_SCHEMA).allow_unknown_sections(true);
     let user_plugin = SectionConfigPlugin::new(
         "user".to_string(),
         Some("userid".to_string()),
-- 
2.30.2





  reply	other threads:[~2022-11-25 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 15:15 [pbs-devel] [PATCH proxmox] section config: support allowing unknown section types Fiona Ebner
2022-11-25 15:15 ` Fiona Ebner [this message]
2022-11-28  8:33   ` [pbs-devel] applied: [PATCH proxmox-mail-forward] pbs user config: allow parsing unknown sections Wolfgang Bumiller
2022-11-28  8:28 ` [pbs-devel] applied: [PATCH proxmox] section config: support allowing unknown section types Wolfgang Bumiller

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=20221125151536.190947-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pbs-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