summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-04-11 13:19:26 +0200
committerLennart Poettering <lennart@poettering.net>2012-04-11 13:20:34 +0200
commit9543ad166338a7bef8718070f11465df4b9badd7 (patch)
treea8c4cae19ec889ba30cb77d8b0bc04091519e41d /src
parent71ecc858fa91a686a050bee51804d43865ce1acc (diff)
main: unset some bash specific environment variables that might get leaked to us
https://bugzilla.redhat.com/show_bug.cgi?id=811537
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index a0bcbdf06d..6656cb4ef0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1343,6 +1343,12 @@ int main(int argc, char *argv[]) {
unsetenv("HOME");
unsetenv("TERM");
+ /* When we are invoked by a shell, these might be set,
+ * but make little sense to pass on */
+ unsetenv("PWD");
+ unsetenv("SHLVL");
+ unsetenv("_");
+
/* All other variables are left as is, so that clients
* can still read them via /proc/1/environ */
}