From 861c2f286ff7e68cbe93f7bc8e43b60638f52848 Mon Sep 17 00:00:00 2001 From: dsmith Date: Wed, 20 Jun 2007 18:00:39 +0000 Subject: 2007-06-20 David Smith * buildrun.cxx (compile_pass): Unset environment variables that could interfere with building the kernel module. Fixes PR 4664. * main.cxx (main): Unsets a few standard environment variables for safety. --- main.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 6c28b25e..f5740aa9 100644 --- a/main.cxx +++ b/main.cxx @@ -461,6 +461,16 @@ main (int argc, char * const argv []) << e << endl; } + // Get rid of a few standard environment variables (which might + // cause us to do unintended things). + rc = unsetenv("IFS") || unsetenv("CDPATH") || unsetenv("ENV") + || unsetenv("BASH_ENV"); + if (rc) + { + const char* e = strerror (errno); + cerr << "unsetenv failed: " << e << endl; + } + s.kernel_base_release.assign(s.kernel_release, 0, s.kernel_release.find('-')); // arguments parsed; get down to business -- cgit