diff options
author | dsmith <dsmith> | 2007-06-20 18:00:39 +0000 |
---|---|---|
committer | dsmith <dsmith> | 2007-06-20 18:00:39 +0000 |
commit | 861c2f286ff7e68cbe93f7bc8e43b60638f52848 (patch) | |
tree | 51b1370cb4656a8263c9c480dcdedbdb0e4f8216 /main.cxx | |
parent | cb53a4f46d192cd6870d873a1c8b2586eb6bd3b4 (diff) | |
download | systemtap-steved-861c2f286ff7e68cbe93f7bc8e43b60638f52848.tar.gz systemtap-steved-861c2f286ff7e68cbe93f7bc8e43b60638f52848.tar.xz systemtap-steved-861c2f286ff7e68cbe93f7bc8e43b60638f52848.zip |
2007-06-20 David Smith <dsmith@redhat.com>
* 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.
Diffstat (limited to 'main.cxx')
-rw-r--r-- | main.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |