openssl: exclude more dangerous environment variables (#30208)

* pkg/openssl: blacklist more dangerous environment variables

* fix style
This commit is contained in:
Tom Scogland 2022-04-22 04:51:18 -07:00 committed by GitHub
parent f961a11187
commit 62553e7521
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,10 +119,11 @@ def handle_fetch_error(self, error):
"insecure. Consider updating to the latest OpenSSL version.")
def install(self, spec, prefix):
# OpenSSL uses a variable APPS in its Makefile. If it happens to be set
# in the environment, then this will override what is set in the
# Makefile, leading to build errors.
env.pop('APPS', None)
# OpenSSL uses these variables in its Makefile or config scripts. If any of them
# happen to be set in the environment, then this will override what is set in
# the script or Makefile, leading to build errors.
for v in ('APPS', 'BUILD', 'RELEASE', 'MACHINE', 'SYSTEM'):
env.pop(v, None)
if str(spec.target.family) in ('x86_64', 'ppc64'):
# This needs to be done for all 64-bit architectures (except Linux,