aboutsummaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-03-08 18:49:37 +0100
committerRichard Levitte <levitte@openssl.org>2018-03-08 20:26:40 +0100
commitfb174faaf51d8b11046873a6a51fc2d8d8c28952 (patch)
treeb61bd992d77ddea54fd348ea0b422d0b8b9dd596 /Configure
parent2bd3b626dddd57217faf7cc267f74754cce9bb58 (diff)
downloadopenssl-fb174faaf51d8b11046873a6a51fc2d8d8c28952.zip
openssl-fb174faaf51d8b11046873a6a51fc2d8d8c28952.tar.gz
openssl-fb174faaf51d8b11046873a6a51fc2d8d8c28952.tar.bz2
Configure: correct the check of env vars vs command line flags
The check to detect if env / make variables conflicted with compiler / linker flags on the configure command line went a little too far, and would stop the configuration process if any such command line flag was given, with no regard for the env / make variables at all. This change refines the check so the stop only gets triggered if any such flags were given AND any of the corresponding variables are set. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5561)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure23
1 files changed, 19 insertions, 4 deletions
diff --git a/Configure b/Configure
index 1b6a7b6..9cf3d75 100755
--- a/Configure
+++ b/Configure
@@ -891,14 +891,29 @@ while (@argvcopy)
}
}
+# If any %useradd entry has been set, we must check that the environment
+# variables haven't been set. We start by checking of any %useradd entry
+# is set.
if (grep { scalar @$_ > 0 } values %useradd) {
- my $detected_env = join(', ', grep { @{$useradd{$_}} || env($_) }
- sort keys %useradd);
- if ($detected_env) {
+ # Hash of env / make variables names. The possible values are:
+ # 1 - environment set
+ # 2 - %useradd entry set
+ # 3 - both set
+ my %detected_env =
+ map { my $v = 0;
+ $v += 1 if env($_);
+ $v += 2 if @{$useradd{$_}};
+ $_ => $v }
+ keys %useradd;
+
+ # If any of the corresponding environment variables is set, we error
+ if (grep { $_ & 1 } values %detected_env) {
+ my $names = join(', ', grep { $detected_env{$_} > 0 }
+ sort keys %detected_env);
die <<"_____";
***** Mixing env / make variables and additional compiler/linker flags as
***** configure command line option is not permitted.
-***** Affected env / make variables: $detected_env
+***** Affected env / make variables: $names
_____
}
}