public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api] pmgpolicy, pmg-smtp-filter: set sensible PATH
Date: Wed, 28 Jun 2023 17:38:04 +0200	[thread overview]
Message-ID: <20230628153804.34055-1-s.ivanov@proxmox.com> (raw)

these 2 services are the only ones that don't have this set (the
additions are copied over from pmgproxy)

with bookworm pmgpolicy throws an error (when invoking 'journalctl'
via run_command (in PMG::Utils::scan_journal_for_rbl_rejects)

did not come to a conclusion why it just resurfaced now, and ran fine
in a bullseye environment

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/bin/pmg-smtp-filter | 4 ++++
 src/bin/pmgpolicy       | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/bin/pmg-smtp-filter b/src/bin/pmg-smtp-filter
index 911e9cd..13da635 100755
--- a/src/bin/pmg-smtp-filter
+++ b/src/bin/pmg-smtp-filter
@@ -49,6 +49,10 @@ use PMG::Statistic;
 
 use base qw(Net::Server::PreFork);
 
+$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
+
+delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
+
 my $opt_commandline = [$0, @ARGV];
 my $opt_max_dequeue = 1;
 my $opt_dequeue_time = 30;
diff --git a/src/bin/pmgpolicy b/src/bin/pmgpolicy
index f5335de..38c3621 100755
--- a/src/bin/pmgpolicy
+++ b/src/bin/pmgpolicy
@@ -27,6 +27,10 @@ use PMG::ClusterConfig;
 
 use base qw(Net::Server::PreForkSimple);
 
+$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
+
+delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
+
 my $greylist_delay = 3*60;            # greylist window
 my $greylist_lifetime = 3600*24*2;    # retry window
 my $greylist_awlifetime = 3600*24*36; # expire window
-- 
2.39.2





             reply	other threads:[~2023-06-28 15:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 15:38 Stoiko Ivanov [this message]
2023-06-28 15:41 ` [pmg-devel] applied: " Thomas Lamprecht

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=20230628153804.34055-1-s.ivanov@proxmox.com \
    --to=s.ivanov@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 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