public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api] pmgpolicy, pmg-smtp-filter: set sensible PATH
@ 2023-06-28 15:38 Stoiko Ivanov
  2023-06-28 15:41 ` [pmg-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2023-06-28 15:38 UTC (permalink / raw)
  To: pmg-devel

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-28 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-28 15:38 [pmg-devel] [PATCH pmg-api] pmgpolicy, pmg-smtp-filter: set sensible PATH Stoiko Ivanov
2023-06-28 15:41 ` [pmg-devel] applied: " Thomas Lamprecht

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