Sanitize the shell environment before loading modules

This commit is contained in:
Devin Carraway 2009-04-14 14:57:58 -07:00 committed by Ask Bjørn Hansen
parent e8ee72a352
commit 6b81c68666

View File

@ -10,6 +10,12 @@
# safety guards # safety guards
use strict; use strict;
BEGIN {
# secure shell
$ENV{'PATH'} = '/bin:/usr/bin';
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
}
# includes # includes
use IO::Socket; use IO::Socket;
use POSIX; use POSIX;
@ -38,10 +44,6 @@ foreach my $sig_name ( split( /\s/, $Config{sig_name} ) )
$sig_num{$sig_name} = $i++; $sig_num{$sig_name} = $i++;
} }
# secure shell
$ENV{'PATH'} = '/bin:/usr/bin';
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
# version # version
my $VERSION = "1.0"; my $VERSION = "1.0";