From 6b81c686666099d0b3751b8a4935e454e341b0dd Mon Sep 17 00:00:00 2001 From: Devin Carraway Date: Tue, 14 Apr 2009 14:57:58 -0700 Subject: [PATCH] Sanitize the shell environment before loading modules --- qpsmtpd-prefork | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qpsmtpd-prefork b/qpsmtpd-prefork index 882c752..3f23df3 100755 --- a/qpsmtpd-prefork +++ b/qpsmtpd-prefork @@ -10,6 +10,12 @@ # safety guards use strict; +BEGIN { + # secure shell + $ENV{'PATH'} = '/bin:/usr/bin'; + delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; +} + # includes use IO::Socket; use POSIX; @@ -38,10 +44,6 @@ foreach my $sig_name ( split( /\s/, $Config{sig_name} ) ) $sig_num{$sig_name} = $i++; } -# secure shell -$ENV{'PATH'} = '/bin:/usr/bin'; -delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; - # version my $VERSION = "1.0";