summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2016-10-22 13:46:08 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2016-11-11 16:27:20 +0100
commit32db2dd39faf0a339c2c26769b98a1924ca09892 (patch)
treefb204fc375d4cee046bb2676b5a4c4194cceb86d /Configure
parentaf25b33d388e2824ad52b31c8f5c7bc722f02dd6 (diff)
downloadperl-32db2dd39faf0a339c2c26769b98a1924ca09892.tar.gz
Remove "." from default @INC when default_inc_excludes_dot is set
Perl now provides a way to build perl without . in @INC by default. If you want this feature, you can build with -Ddefault_inc_excludes_dot Because the testing / make process for perl modules do not function well with . missing from @INC, Perl now supports the environment variable PERL_USE_UNSAFE_INC=1 which makes Perl behave as it previously did, returning . to @INC in all child processes. WARNING: PERL_USE_UNSAFE_INC has been provided during the perl 5.25 development cycle and is not guaranteed to function in perl 5.26. Update unit tests and default value files to work with the new %Config variable "default_inc_excludes_dot"
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure24
1 files changed, 24 insertions, 0 deletions
diff --git a/Configure b/Configure
index 44920204aa..84a34bf597 100755
--- a/Configure
+++ b/Configure
@@ -937,6 +937,7 @@ d_wcstombs=''
d_wcsxfrm=''
d_wctomb=''
d_writev=''
+default_inc_excludes_dot=''
dlext=''
bin_ELF=''
cccdlflags=''
@@ -20625,6 +20626,28 @@ EOCP
;;
esac
+: Include . in @INC
+$cat <<EOM
+
+Historically Perl has provided a final fallback of the current working
+directory '.' when searching for a library. This, however, can lead to
+problems when a Perl program which loads optional modules is called from
+a shared directory. This can lead to executing unexpected code.
+
+EOM
+
+case "$default_inc_excludes_dot" in
+ $define|true|[yY]*) dflt="n" ;;
+ *) dflt='y' ;;
+esac
+
+rp='Provide '.' in @INC by default? '
+. ./myread
+case "$ans" in
+ [nN]*|define) default_inc_excludes_dot="$define" ;;
+ *) default_inc_excludes_dot="$undef" ;;
+esac
+
: Check what kind of inf/nan your system has
$echo "Checking the kind of infinities and nans you have..." >&4
$echo "(The following tests may crash. That's okay.)" >&4
@@ -24913,6 +24936,7 @@ db_prefixtype='$db_prefixtype'
db_version_major='$db_version_major'
db_version_minor='$db_version_minor'
db_version_patch='$db_version_patch'
+default_inc_excludes_dot='$default_inc_excludes_dot'
direntrytype='$direntrytype'
dlext='$dlext'
dlsrc='$dlsrc'