From: Phil Pennock Date: Sat, 11 Feb 2017 00:37:44 +0000 (-0500) Subject: perl paranoia about @INC X-Git-Tag: exim-4.90devstart~11 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/4d3d955f2791199b35704c3e9784dc99fd229696 perl paranoia about @INC --- diff --git a/src/src/convert4r3.src b/src/src/convert4r3.src index 810b3374f..632eb70d7 100755 --- a/src/src/convert4r3.src +++ b/src/src/convert4r3.src @@ -8,6 +8,7 @@ # It is assumed that the input is a valid Exim configuration file. use warnings; +BEGIN { pop @INC if $INC[-1] eq '.' }; ################################################## # Analyse one line # diff --git a/src/src/convert4r4.src b/src/src/convert4r4.src index 8075602cb..fff4e478b 100755 --- a/src/src/convert4r4.src +++ b/src/src/convert4r4.src @@ -7,6 +7,7 @@ # It is assumed that the input is a valid Exim 3 configuration file. use warnings; +BEGIN { pop @INC if $INC[-1] eq '.' }; # These are lists of main options which are abolished in Exim 4. # The first contains options that are used to construct new options. diff --git a/src/src/exigrep.src b/src/src/exigrep.src index e8857126e..faa5cb73b 100644 --- a/src/src/exigrep.src +++ b/src/src/exigrep.src @@ -2,6 +2,7 @@ use warnings; use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; # Copyright (c) 2007-2015 University of Cambridge. # See the file NOTICE for conditions of use and distribution. diff --git a/src/src/exim_checkaccess.src b/src/src/exim_checkaccess.src index 84d03c0b3..a780a298a 100755 --- a/src/src/exim_checkaccess.src +++ b/src/src/exim_checkaccess.src @@ -63,6 +63,7 @@ if test "$exim_path" = ""; then exim_path=BIN_DIRECTORY/exim; fi PERL_COMMAND - $exim_path $args <<'End' +BEGIN { pop @INC if $INC[-1] eq '.' }; use FileHandle; use IPC::Open2; diff --git a/src/src/eximstats.src b/src/src/eximstats.src index 7e74db885..a2113f106 100644 --- a/src/src/eximstats.src +++ b/src/src/eximstats.src @@ -549,6 +549,7 @@ Merging of xls files is not (yet) possible. Be free to implement :) use warnings; use integer; +BEGIN { pop @INC if $INC[-1] eq '.' }; use strict; use IO::File; diff --git a/src/src/exinext.src b/src/src/exinext.src index 182e39574..9c427350b 100644 --- a/src/src/exinext.src +++ b/src/src/exinext.src @@ -115,6 +115,9 @@ fi perl - $exim_path "$eximmacdef" $argone $spool_directory $qualify_domain $config <<'End' + # We don't import anything, but guard against future changes which do + BEGIN { pop @INC if $INC[-1] eq '.' }; + # Name the arguments $exim = $ARGV[0]; diff --git a/src/src/exipick.src b/src/src/exipick.src index 1672c7fe6..4999d843f 100644 --- a/src/src/exipick.src +++ b/src/src/exipick.src @@ -12,6 +12,7 @@ my $charset = 'ISO-8859-1'; # http://www.exim.org/eximwiki/ToolExipickManPage use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; use Getopt::Long; my($p_name) = $0 =~ m|/?([^/]+)$|; diff --git a/src/src/exiqgrep.src b/src/src/exiqgrep.src index ae617c4e1..d900e9933 100644 --- a/src/src/exiqgrep.src +++ b/src/src/exiqgrep.src @@ -18,6 +18,7 @@ # Version 1.2 use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; use Getopt::Std; # Have this variable point to your exim binary. diff --git a/src/src/exiqsumm.src b/src/src/exiqsumm.src index c8b522ef5..99a304fef 100644 --- a/src/src/exiqsumm.src +++ b/src/src/exiqsumm.src @@ -42,6 +42,7 @@ # Slightly modified sub from eximstats use warnings; +BEGIN { pop @INC if $INC[-1] eq '.' }; sub print_volume_rounded { my($x) = pop @_; diff --git a/src/src/transport-filter.src b/src/src/transport-filter.src index 2558bd7ec..3f250e657 100644 --- a/src/src/transport-filter.src +++ b/src/src/transport-filter.src @@ -12,6 +12,7 @@ ############################################################################# use warnings; +BEGIN { pop @INC if $INC[-1] eq '.' }; # If the filter is called with any arguments, insert them into the message # as X-Arg headers, just to verify what they are. diff --git a/src/util/cramtest.pl b/src/util/cramtest.pl index cb70eb404..48f989a0c 100755 --- a/src/util/cramtest.pl +++ b/src/util/cramtest.pl @@ -24,6 +24,8 @@ # Vadim Vygonets . All rights reserved. # Public domain is OK with me. +BEGIN { pop @INC if $INC[-1] eq '.' }; + use MIME::Base64; use Digest::MD5; diff --git a/src/util/mkcdb.pl b/src/util/mkcdb.pl index 16827c63b..691849dcd 100755 --- a/src/util/mkcdb.pl +++ b/src/util/mkcdb.pl @@ -15,6 +15,7 @@ use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; $ENV{'PATH'} = ""; umask(022); diff --git a/src/util/ocsp_fetch.pl b/src/util/ocsp_fetch.pl index 0d214d62a..08ca4cbe4 100755 --- a/src/util/ocsp_fetch.pl +++ b/src/util/ocsp_fetch.pl @@ -2,6 +2,7 @@ # Copyright (C) 2012 Wizards Internet Ltd # License GPLv2: GNU GPL version 2 use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; use Getopt::Std; $Getopt::Std::STANDARD_HELP_VERSION=1; use IO::Handle; diff --git a/src/util/proxy_protocol_client.pl b/src/util/proxy_protocol_client.pl index feae3ca90..67a171d5d 100644 --- a/src/util/proxy_protocol_client.pl +++ b/src/util/proxy_protocol_client.pl @@ -21,6 +21,7 @@ # use strict; use warnings; +BEGIN { pop @INC if $INC[-1] eq '.' }; use IO::Select; use IO::Socket; use Getopt::Long; diff --git a/src/util/ratelimit.pl b/src/util/ratelimit.pl index d7fd43ab1..e212fa241 100644 --- a/src/util/ratelimit.pl +++ b/src/util/ratelimit.pl @@ -2,6 +2,8 @@ use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; + sub usage () { print <